|
Re: Capturing Page number and total pages for use in format trigger [message #377945 is a reply to message #377943] |
Fri, 26 December 2008 14:04 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
You can not, as far as I can tell. Current page number is easy: SRW.GET_PAGE_NUM will return the current page number. But, in order to know the last page number, report has to finish, really get to the last page as it may differ, depending on fields' formatting (vertical elasticity, for example, may cause the same report have different page number for different data). Therefore, there's no "GET_LAST_PAGE_NUM".
However: you might create a package ("pkg_last_page") which will contain declaration of a variable; let's call it "last_page". Its datatype should be NUMBER. Then, create a format trigger of the object which will certainly be displayed on the last report page (for example, this might be the top parent report frame) which would use previously mentioned SRW's function:srw.get_page_num(pkg_last_page.last_page); A package variable will contain the last page number once the report gets to the last page. So, how to capture it? Using the AFTER-REPORT trigger! Declare a variable and get the last page number asmy_variable := pkg_last_page.last_page; Though, I don't know how can you use it in the field format trigger; after report will fire after the report is finished, so ... here's where the good news end.
If you ever manage to develop something useful from these information, please, share it with the rest of the community.
|
|
|