Apice and pedice

edited 10:54AM in FastReport 2.xx VCL
I want to know if is possible to write special text format in a report.
I talk about chemical formula simbols for "pedice" and "apice" numbers.

For example "H2o", with the number 2 a little bit more down than the oder caratters.

I don't know the english traslation of words "apice" and "pedice", sorry.

Thanks a lot. Giacomo.

Comments

  • edited 10:54AM
    Hi Giacomo!

    As I know there is no report engine that can successfully solve the problem You throw up. (Anyway they are superscript and subscript in english if I right) But with a little workaround everything can be solved like any others in FR. So: threre is a Delphi component called ChemText that is especially developed to render chemical formulas to any TCanvas descendant with automatically placed superscripts and subscripts. It can be downloaded from the following URL: 'http://www.jh-inst.cas.cz/~spanel/DOWNLD/Chemtxt.zip'. In FR You can put an TFRPictureView object and leave it empty. In the report component's OnBeforePrint event handler (on Delphi level) examine the passed TFRView parameter for being the desired image component. If it is then create a TBitmap instance set its appropriate properties (Brush.Color, Font.....), fill its canvas with FillRect, and then render the desired chemical formula with the aid of the above component on the TBitmap instance's canvas. After the rendering assig the bitmap instance to the pictureview component. This way You can write a function that will return a TBitmap instance with the rendered formula on it based on input parameters (the formula, font, etc) and it can be assigned to the pictureview component. If You need code write here.

    Regards:Alex
  • edited 10:54AM
    Thanks a lot.
    ChemText works very fine!

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.