TfrMemoView Autosize

Hi,

I test FastReport before to include it in a software.

I have a little problem. I use a Tfrmemoview but I need that the memo resize it width when it print.

I use 2 component for one line. First for ID and second for value
Qualit?© : ......................................|
| Bonne |
Actually the result is

Qualit?© : .................. Bonne |

In fact, I need to get

Qualit?© : ........................... Bonne |

Is it possible to do that ?

Jean-Luc!

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 10:50AM
    Hi Jean Luc
    not exactly sure of what you are trying to do here.
    but if it is trying to vary the number of periods between
    Qualite : .. Bonne.
    you could do something like this
    create a variable myfilltxt in dictionary set it to'..........' max number of dots.
    then use copy function to set desired number of dots
    using 1 memo, memo could contain
    | static text [copy([myfilltxt],1,[numreq])] [fieldvalue] |
    and right justify it
    you can then set the value for numreq in the obp event of the band based on the value of an expression.
    or if you have added function library from powerpak installed you could use pad functions.
    this should give you some ideas.
    regards ;)
  • edited 10:50AM
    I tried to use the example provided by gordk but it doesn't display properly. The problem is that the dots doesn't allocate the same width as a normal character. Therefor even if I add different amounts of dots (based on lastname+surname length) the last character is printed at different locations.

    My field looks like this: Lastname, Surname ....... #pagenr. These strings are stored in a Stringlist which is printed in a for loop except dots which is a variable (like numreq).

    Example:
    Johnson, John.................. 56

    Is there a way to change the width of a character so whatever it print, it allocates the same width on a line? I'm actually using FR 3
  • gordkgordk St.Catherines On. Canada.
    edited 10:50AM
    if using fr3 then post in the fr3 forum.
    to do what you want, you need to use 3 tfrx memo views, would be better if name was one field, page was last field, and dots are just text in over sized in width memo, in between.
    auto size first memoview, retrieve calcwidth then set the left and width props of other memoviews as needed.
  • edited February 2009
    It's working! You're a lifesaver gordk! There's only one more problem. When calculating the size of the dots i first set Calcwidth on col 1 and col 3 (dots is col2 then). The problem is that in these columns I have text with embedded html for formatting. The calcwidth then gives a bigger width value than what it is after printed. Hence the Dots.Left is placed with spaces.
    I have tried using different combinations of OnBeforeprint & OnBeforeData with no success. I would like to change on which order the columns (memoviews) events are being handled so that dots are managed last. In other words, first supply data for col 1 and 3, then print and replace html tags, calculatewidth and set values of dots from calwidth on col 1 and 3.

    I can't seem to post items in the forum, just reply. I sent an email to the forum administrator with no reply yet.

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.