Reset Page Number

JanWS

Active Member
Hi list, I know this topic has been covered before but I can not find a working solution.
Problem: We want to reset the "Page X of Y" runtime variable. We all know BSFN B9800580 isn't the right answer.
Are there people out there who successfully used the API ubeReport_SetPageNumberEx in a custom BSFN ? If so, can you explain me how to use this API (parameters,...) and maybe share some sample code !? Many thanks.

Jan Hox, JDE Developer, XE U6 SP 20.0
 
In a business function, use the following exported API something like this:

/* nPageNumber: set the page number to any number you want... */
/* nResetTotalPages: 1: resets the total pages to 1, 0: leaves it alone */
ubeReport_SetPageNumberEx(lpBhvrCom, lpDS->nPageNumber, lpDS->nResetTotalPages);

Usually, when you begin a new group, ie, you want to go from 1 of 2, 2 of 2 to 1 of 3, 2 of 3, you would call this inbetween with:
ubeReport_SetPageNumberEx(lpBhvrCom, 1, 1);

If that is the only use you need, you can choose to make a very simple BSFN. Note: param 2 is a long, 3 is an int.

Have fun.
 
Thanks Seg. To give you an update on the situation. The reply you posted got me started to write the BSFN, but I used a boolean (TRUE/FALSE) instead of an integer to reset the "Total Of X" part. It works OK.

Jan Hox XE U6 SP. 20.0
 
Hi List,
Concerning this Reset Page Number issue I found something really strange...
I wrote a business function with the appropriate API call (I used two integer parameters) and used it in my report.
The result was:
Pages 1-33 correct numbering 1 of 1, 1 of 2, 2 of 2, 1 of 1 etc.
The rest 1 of 0, 1 of 2342345876 etc - incorrect numbers without any logic

It seems to me that the buffer for the total pages is too small so the Runtime Variable fetches data from the wrong part of memory...

Has anybody seen anything like this???
Regards:
Gergely Pongrácz
e-Best, Hungary
 
Hi Gergely... I am Having the same issue!!! :-(
After 500 pages (more or less) the report prints "Page 1 of 1109906933" ... so It seems that the API has a memory problem... anyway The solution seems to be not so easy.. ciao

CB
 
Hi Jan,
I have the Same problem in Printing the page numbers. if dont have any problem, if possible can you plz share the BSFN?

Thanks and Regards ,
Shams
One World Xe SP22
 
Hello Shams, attached you can find the source code for this basic BSFN. Remember, as posted above, there were memory leaks involved with this API, so this function will only function properly if you're on XE SP22.1 or higher.

Regards,

JanOW OW B7334 SP 22 Oracle 9i
 

Attachments

  • 74263-B5900021.h
    3.6 KB · Views: 200
Hi! Can you send me the .c and .h file

I want to reset Page Total Y.

In my case it is:

Example: if Purchase Order 1018 has 3 pages, PO 1019 has 1 page and PO 1020 has 4 pages.

Output
PO 1018 (if there are three pages to print)
Page 1 of 4
Page 2 of 4
Page 3 of 4


PO 1019 (if there is one page to print)
Page 1 of 4


PO 1020 (if there are four pages to print)
Page 1 of 4
Page 2 of 4
Page 3 of 4
Page 4 of 4


In the above scenario, it always prints maximum number in total pages.
Since PO 1020 has 4 pages.

Would appreciate you help.

Please reply at [email protected]

Thanks
 
Back
Top