TOTALPAGES

Probably another newbie simplistic question...

I have a field on my page footer set to 'Page [PAGE#] of [TOTALPAGES]' (without the quotes of course) and the Two-pass report option checked but I still get Page 1 of 0, Page 2 of 0, etc.

Any idea?

Comments

  • edited 3:14AM
    Ayayayayay, I did it again.

    Okay, here is what I've done...

    In frReport1.OnGetValue I thought I would speed-up the report creation - as if FastReport was not fast enough already - by checking only the first two characters of ParName instead of its entire content. Since I had a variable called [TOTAL], OnGetValue was returning the proper 'total' ParValue whenever ParName would start with 'TO'. What I didn't realize then is that the [TOTALPAGES] variable is also passed to the OnGetValue method just as all the other variables found in the report definition. As a result, I was feeding the [TOTALPAGES] variable with the value prepared for the [TOTAL] variable; the exact reason why [TOTALPAGES] was not showing what it should have shown in the first place. ;)

    I am not sure why variables like [DATE], [PAGE#] and [TOTALPAGES] are passed to the TfrReport.OnGetValue method but I am sure that the writers of FastReport have a good reason for doing it. Either way, I hope this explanation can help some other newbie like me.

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.