PAGE x OF y on a report

EAGLEEAGLE Member Posts: 2
Hi everyone...

This simple article might be usefull.

1. Create a singleinstances codeunit (named it PAGExOFy) with 2 functions on it :

SetLastPage(LastPage : Integer)
OurLastPage := LastPage;

GetLastPage() : Integer
Exit(OurLastPage);

2. Design a report and put a code on a OnPostReport trigger :

OnPostReport()
PAGExOFy.SetLastPage(CurrReport.PAGENO);

3. Put 2 TextBox on a report, the first one, or the x one (as we all know) is simply put CurrReport.PAGENO on its SourceExpr property.
The second one, or the y one, put PAGExOFy.GetLastPage on its SourceExpr property.

4. Unfortunately with this method, which is the only simple method i know, i have to preview the report twice, to make the y number on PAGE x OF y, to be displayed correctly.


I hope this method might help for anyone who need it...until we (specially me, considering im a new user at this forum) can get a better method.

Thanks

Comments

Sign In or Register to comment.