Home » Developer & Programmer » Reports & Discoverer » Capturing Page number and total pages for use in format trigger (reports 10g)
Capturing Page number and total pages for use in format trigger [message #377943] Fri, 26 December 2008 12:32 Go to next message
myna
Messages: 1
Registered: November 2006
Location: Bangalore
Junior Member
Hi,

I want to refer current page number and total pages in a format trigger like page_number = total_pages then display other wise don display. Can any one of you can tell me how can i do this...
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 Go to previous message
Littlefoot
Messages: 20896
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 as
my_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.
Previous Topic: Selected Rows
Next Topic: when check box check (check record will not show in report )
Goto Forum:
  


Current Time: Tue Dec 06 12:30:03 CST 2016

Total time taken to generate the page: 0.10490 seconds