Home » Developer & Programmer » Reports & Discoverer » Total Page Number (Oracle Report 6i)
Total Page Number [message #404214] Wed, 20 May 2009 22:23 Go to next message
shekhar.salunkhe
Messages: 154
Registered: January 2008
Location: Pune
Senior Member
Hello all,
Can anybody tell me, How can I get Total Number Pages in report?
I have used srw.get_page_num in format trigger.
But for that function User must have to go last page. So I want to know last page number without going to last page.
Plese Help me
Thanks
Re: Total Page Number [message #404220 is a reply to message #404214] Thu, 21 May 2009 00:04 Go to previous messageGo to next message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As far as I know, you can't do that unless you reach the last page. It means that report doesn't know total number of pages until it is completely formatted which, actually, means that it must get to its last page.

I've seen quite a few questions like yours but no satisfactory answer so far. Sorry.
Re: Total Page Number [message #404230 is a reply to message #404214] Thu, 21 May 2009 01:04 Go to previous messageGo to next message
hisham99
Messages: 86
Registered: October 2008
Location: united arab emirates
Member
go to your layout report
1- create field
2-open property of that field and change the source to(total pages)
3-run your report it will show you the total number of that report on the first page
Re: Total Page Number [message #404239 is a reply to message #404230] Thu, 21 May 2009 01:47 Go to previous messageGo to next message
shekhar.salunkhe
Messages: 154
Registered: January 2008
Location: Pune
Senior Member
Thanks for all ..
Can I get that Value of field which is added on layout for Total pages.
So that I can Store in table.
Re: Total Page Number [message #404254 is a reply to message #404230] Thu, 21 May 2009 02:25 Go to previous messageGo to next message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Hisham99,

your suggestion works fine - as far as displaying a total number of pages is concerned. You don't even have to create a field - it can be done by specifying it using the ampersand (&) character in the Paper Layout Editor as
&totalpages


However, the problem is how to find that number in Data Model layout ... people would usually want to perform certain calculations based on "total number of pages", such as storing it into a table (as @shekhar.salunkhe would like to) or
if current_page_number = total_number_of_pages then
   do_something;
end if;

Do you know how to do that?
Re: Total Page Number [message #404285 is a reply to message #404254] Thu, 21 May 2009 04:41 Go to previous messageGo to next message
shekhar.salunkhe
Messages: 154
Registered: January 2008
Location: Pune
Senior Member
Yes Sir,
Actually I want that total number of pages store into a table.
And by using that number, I have to calculate charges per page but without going to last page of report. (I mean User need not go to last page)

Please Help me...
Re: Total Page Number [message #404700 is a reply to message #404285] Fri, 22 May 2009 21:54 Go to previous messageGo to next message
shekhar.salunkhe
Messages: 154
Registered: January 2008
Location: Pune
Senior Member
Any New Suggestion?
Re: Total Page Number [message #404814 is a reply to message #404214] Sun, 24 May 2009 08:13 Go to previous messageGo to next message
hisham99
Messages: 86
Registered: October 2008
Location: united arab emirates
Member
i try this report and its work fine
first you have to create this table using (scott/tiger)
create table code
(page_num number(6));
  • Attachment: page_num.rdf
    (Size: 84.00KB, Downloaded 239 times)
Re: Total Page Number [message #404816 is a reply to message #404214] Sun, 24 May 2009 08:33 Go to previous messageGo to next message
hisham99
Messages: 86
Registered: October 2008
Location: united arab emirates
Member
sorry ! please use this attachment
  • Attachment: page_num.rdf
    (Size: 92.00KB, Downloaded 315 times)
Re: Total Page Number [message #404842 is a reply to message #404214] Sun, 24 May 2009 23:13 Go to previous messageGo to next message
hisham99
Messages: 86
Registered: October 2008
Location: united arab emirates
Member
if you want to store only the last page number then
make some change in insert_page procedure as below

PROCEDURE insert_pages( p_page in number) is

begin
update scott.code
set page_num =p_page;

if sql%rowcount=0 then
insert into scott.code(page_num)
values
(p_page);
end if;
commit;
end;
Re: Total Page Number [message #405147 is a reply to message #404814] Tue, 26 May 2009 09:59 Go to previous message
shekhar.salunkhe
Messages: 154
Registered: January 2008
Location: Pune
Senior Member
Thanks a lot,
Problem is solved
Previous Topic: Inventory Valuation with Fifo and Lifo
Next Topic: Excel output from Oracle Reports 3.0
Goto Forum:
  


Current Time: Sat Dec 03 17:57:18 CST 2016

Total time taken to generate the page: 0.21515 seconds