«

»

Feb 18 2013

Reset Page Count (Page X of Y) in UBE

VN:F [1.9.22_1171]
Rating: 5.0/5 (4 votes cast)

PageNosReports like Sales Order Print, Invoice Print, Purchase Order Print often have the requirement to print the Page Numbers inline with the Orders. For e.g. each order should have Page numbers starting from 1. It becomes even complex when you have to reset page numbers like Page X of Y (like Page 1 of 3, Page 2 of 3 and Page 3 of 3) where X is the concurrent page number and Y is the total page count for an order.

To Reset Page the number is easy, where you just have to call the B9800580-Set Report Page Number BSFN to reset to the page number you need. But when you need to show the Total pages for an order or so, this BSFN does not satisfy the requirement. The B9800580 uses the API – ubeReport_SetpageNumber. To reset the Y value (Total number of pages), use a different API called ubeReport_SetPageNumberEx :

ubeReport_SetPageNumberEx(lpBhvrCom, lpDS->nPageNumber, lpDS->nResetTotalPages);

Where nPageNumber: set the page number to any number you want
nResetTotalPages: 1: resets the total pages to 1, 0: leaves it alone

Following is how you achieve the requirement.

  1. Create Data structure D5598058:
    1. PAGN – Page Number
    2. PGNF – Page Number Report (pass only 1 or 0)
    3. SUPPS – Suppress Error Message
    4. DTAI – Error Message ID
  2. Create a Custom BSFN : B5598058 – Set Report Page Number Ex
    /************************************************************************
    * Variable declarations
    ************************************************************************/
    int nPageNumber; //PAGN
    int nResetTotalPages; //PGNF
    /************************************************************************
    * Main Processing
    ************************************************************************/
      jdeStrcpy (lpDS->szErrorMessageID, _J(" "));
      MathNumericToInt (&lpDS->mnPageNumber, &nPageNumber);
      MathNumericToInt (&lpDS->mnPageNumberReport, &nResetTotalPages);
      if ((nNumber < 0) || (nNumber > 9999) ||
    (!ubeReport_SetPageNumberEx (lpBhvrCom, nPageNumber, nResetTotalPages)))
      {
        jdeStrcpy (lpDS->szErrorMessageID, _J("0279"));
      }
    /************************************************************************
    * Function Clean Up
    ************************************************************************/
      if (lpDS->szErrorMessageID[0] != _J(' '))
      {
        return (ER_ERROR);
      }
      else
      {
        return (ER_SUCCESS); 
      }
  3. On the Level Break Header of Order Number, call the Custom BSFN to reset the Page Number.

Hope this helps many!

Published under the license.

VN:F [1.9.22_1171]
Rating: 5.0/5 (4 votes cast)
Reset Page Count (Page X of Y) in UBE, 5.0 out of 5 based on 4 ratings
(Visited 102 times, 1 visits today)

About the author

Deepesh M Divakaran

Deepesh MD is more of a Gizmo Geek, and a techie.
A very experienced Technical Consultant on Oracle JD Edwards EnterpriseOne, and OneWorld. As a consultant he has worked for wide range of industries, from Manufacturing, Media, Oil & gas etc. and has worked on re-engineering modules, and areas of customization.
With a touch of class and understanding towards what ever he does, he is often regarded by his colleagues as the one stop answer for all Technical/Software related queries.

7 comments

Skip to comment form

  1. Satish Kanth

    Nice one…
    You can check this also
    http://peoplesoft.ittoolbox.com/groups/technical-functional/jdedwards-l/resolved-issue-with-y-portion-of-page-x-of-y-947563

    VN:F [1.9.22_1171]
    Rating: +1 (from 1 vote)
  2. Sankarguru Mani

    Deepesh,

    Does this API ubeReport_SetPageNumberEx supported in higher releases like 9.0? I guess its working only XE. Can u please confirm the same?

    Regards,
    Sankarguru Mani

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    1. Deepesh M Divakaran

      Sankarguru,
      This API applies to JD Edwards EnterpriseOne Tools – Version S23 and later.

      Deepesh

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  3. Sankarguru Mani

    Deepesh,

    nNumber is not declared anywhere, what is the value its holding? or is it referring to mnPageNumber?

    Regards,
    Sankar

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    1. Deepesh M Divakaran

      Hi Sankarguru,

      I have formatted the code for readability. The Variable’s being typecasted to int.

      Deepesh

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  4. Sandeep KP

    good one

    VN:F [1.9.22_1171]
    Rating: +1 (from 1 vote)
  5. MURALI

    please send the all the discussions to my mail.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)

Leave a Reply