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?
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
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.