Lazarus

Programming => Packages and Libraries => LazReport => Topic started by: joceravolo on September 13, 2019, 11:17:48 pm

Title: Problem creating variable to display page count
Post by: joceravolo on September 13, 2019, 11:17:48 pm
Hi Guys,

I am new to this and I am using Codetyphon 6.8.
I want to create a variable to display the page count in this format:
Page X
I created a variable with this expression 'Page ' + inttostr(PageNo)
That gives me an error that it expects string but is getting boolean.
I can't find samples for the reports. That would help.

Thanks in advance,

Joe.
Title: Re: Problem creating variable to display page count
Post by: Handoko on September 14, 2019, 06:44:15 am
Hello joceravolo,
Welcome to the forum.

You don't need to create a variable for it. Double click on the frReport component and do these:

1. Click the insert rectangle object (on the left toolbar) and click on the location you want to put it
2. Put this: Page [PAGE#] in the text editor
3. Click the OK button to close the editor

Note:
This Lazarus/FPC forum, not CodeTyphon.
Title: Re: Problem creating variable to display page count
Post by: joceravolo on October 28, 2019, 08:34:08 pm
Thanks Handoko.
But on Dephi I use variables extensively.
Not only for page number, most of the times I use variable made from the database fields to accomplish different things.
Title: Re: Problem creating variable to display page count
Post by: GAN on October 29, 2019, 06:23:21 am
Use variables, see https://wiki.freepascal.org/LazReport_Tutorial#General_purpose_variables (https://wiki.freepascal.org/LazReport_Tutorial#General_purpose_variables) and OnGetValue event.
TinyPortal © 2005-2018