Barcode - centering text and memoViews

edited 11:49AM in FastReport VCL 5
Due to forcing EAN128 barcode to act as GS1-128 in my project, there is a little problem with barcode description (human-readable text {HRT} below the code).
Description string {HRT} should be different than code data, but there seems to not be possible using any properties. I wrote few functions in PascalScript and they do the proper job with data, special chars, parentheses etc.

E.g. barcode data should be:
2401234&1;101234
but {HRT} should be printed as:
(240)1234(10)1234

Simple (and ugly) solution is to put "memoView" below the code and set "showText" property of barcode to false. But there is another problem - exact centering text with code of variable length. You may think, there is nothing easier than set memoView.Width := Barcode.Width in PascalScript. But during report execution, barcode.width property, readed by PascalScript, has always the same, independed of code length value, which is equal to initial width in design time (FR bug?).

Does anyone have any solution to proper center this text with barcode? And the most important condition - solution must be independent of application source code.

Comments

  • gpigpi
    edited 11:49AM
    wrote:
    And the most important condition - solution must be independent of application source code.
    You can get TfrxBarCode width in the Delphi's code only. Use TfrxBarCodeView.GetRealBounds
  • edited 11:49AM
    gpi wrote: »
    gpi wrote: »
    And the most important condition - solution must be independent of application source code.
    You can get TfrxBarCode width in the Delphi's code only. Use TfrxBarCodeView.GetRealBounds

    THX gpi. I was afraid of this. Dependency of this kind is unacceptable this time.
    Incidentally, FR is great tool, but why functionality like separate {HRT} of barcode data is not so obvious for FR team?

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.