Help - Search - Members - Calendar
Full Version: TfrMemoView Autosize
Fast Reports forum > Fast Reports Products > FastReport 2.xx VCL
alphomega
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!
gordk
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 wink.gif
Eldborn
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
gordk
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.
Eldborn
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.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.