• Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

UBE Page Numbers

janemcs123

Active Member
Can anyone help me? I'm modifying a UBE and the customer wants to show pages N of XX, for each separate order. How do I get this to reset for each new order so that it shows: order 555 - page 1 of 3, 2 of 3, 3 of 3, Order 556 - 1 of 4, 2 of 4 ...

I hope that makes some sense!

Jane.

Release: XE, SP 13.
 

Zoltan_Gyimesi

Legendary Poster
Jane,

As you know, you can use "Page n of Total" runtime fields on Page Header/Footer section under XE.
If you search for "*Page Number*" amoung business functions you will get 3 entries:
======================================================================
Function Name Source Module Description
SetReportPageNumber B9800580 Set Report Page Number
ubeReportGetPageNumber N94NM16A Get Page Number
ubeSetPageNumber N94NM16A Set Page Number
======================================================================
Unfortunately they haven't attachment (except one but that is forgotable too) but 2 of three is NER BSFN.
Try to examine them and/or making experiments with them.
Hopefully one of them could be a tool for you.

Please, let us know your results on the List/Forum. Thanks.

Good luck for exploring "How to use" these BSFNs,
Zoltán

B7332 SP11, ESU 4116422, Intel NT4, SQL 7 SP1
(working with B7321, B7331, XE too)
 

janemcs123

Active Member
Zoltán,

Thanks for your reply.

I tried using the SetReportPageNumber business function and got some mixed results. I've added the business function to the relevant level break footer to reset the page number to Zero.Without it I am getting:

order 555 Page 1 of 100, 2 of 100 ...
order 556 Page 3 of 100
...
order 576 Page 100 of 100

If I use the business function, the page number resets correctly, but the total pages doesn't so I get

order 555, page 1 of 1, page 2 of 1 ...
order 556, page 1 of 1, page 2 of 1 ...

I guess I'll have to keep working at it - Anyone else got any tips?

Jane.
 

Sunil

Member
Hi Jane,

There is a API u need to use in order to reset the Page Number Total.
The API name is ubeReport_SetPageNumberEx. A C BSFN needs to be written using this API. The BSFN can be as simple as having just one line of the above API. The other lines required for the Business Function are automatically added when u use the Create button from the Form Exit of the Business Function Design.
I am giving the code e.g below
********************************************************************

ubeReport_SetPageNumberEx(lpBhvrCom,lpDS->nnumberPage,lpDS->cBoolean)

The Parameters definitions are as follows
Parameter1 - Standard JDE Behaviour Parameter.
Parameter2 - The value to which u want to reset the Page Number. Normally set to 1 at each Level Break at which u want to have Page Break.
Parameter3 - Boolean Value. Pass a char variable with value '1' if you want to reset the total number of pages

*********************************************************************

BUT THE MOST IMPORTANT THING IS THAT THIS API IS ONLY PRESENT IN XE.

Thanks
Sunil
 

Larry_Jones

Legendary Poster
Jane,

did the API Sunil supplied work for you?
I now need to do something similar (reset page number and total pages for multiple documents in one UBE run) and would like to know if this approach worked before I go to far down the path.

TIA,


Larry Jones
ljones@wagstaff.com
OneWorld B733.1, SP 11.3
HPUX 11, Oracle SE 8.1.6
SandBox: OneWorld XE SP15
 

Larry_Jones

Legendary Poster
I was premature ... The API resets page numbers very well. Unfortunately the Total Page number count, if reset, affects all documents in the output file - so I still can't get my 1 of 2, 2 of 2, 1 of 5, ...

Kannen, attached find the BSFN .c and .h files as well as screen snapshots of the Data Structure object that must be created.

Regards,

Larry Jones
ljones@wagstaff.com
OneWorld B733.1, SP 11.3
HPUX 11, Oracle SE 8.1.6
SandBox: OneWorld XE SP15
 

Attachments

janemcs123

Active Member
Larry,

Sorry I didn't get back to you sooner. What are the problems you are having with the Total Pages using the BSFN? I haven't had a chance to try it out because other issues have taken a priority and so page numbering has had to take a back-burner. Keep us informed of your progress though - I'd love to know if you get it resolved.

Cheers,

Jane.
 

Larry_Jones

Legendary Poster
Hey Jane,

The API works well - it just doesn't work like we want it to.
Resetting the current page number works fine.
When you reset the Total Pages however it changes the value on ALL pages in the job, not just from that point forward.

Bummer

Larry Jones
ljones@wagstaff.com
OneWorld B733.1, SP 11.3
HPUX 11, Oracle SE 8.1.6
SandBox: OneWorld XE SP15
 

janemcs123

Active Member
Larry,

Sounds like the Total Page numbers is only calculated once for the total output of the report. I'm sure I've seen reports where it has recalculated mid report before - specifically on the statement print report - I just wish I knew how. Sounds like we'll have to do more experimenting.

It's got me thinking that perhaps there is some logic on the standard statement print ube's that is capable of doing a recalculation. It might be worth doing some digging around there.

Cheers,

Jane.
 
Top