Sunday, January 2, 2022

XML publisher reports (RTF) Check printing

 XML publisher reports (RTF) Check printing




I have a customer who wants to convert their 40+ Oracle Apps reports to ‘XML publisher’ Reports. These reports are fall in categories of AR invoice report, check printing report and PO print report which they are printing on pre-printed (pre-defined) stationary.

Just a little background of pre-printed stationary report’s layout where there is a fix Header section and fix Detail Section Table. The detail section table should always have fixed table height, in the sense it should always have fix number of rows in the table no matter how many rows are returned by the actual report run. For example, Invoice stationery has fix 30 rows inline detail table, and the Actual report run is returning only 5 rows then rest of 25 blank rows should be generated programmatically.



So far there are solutions available that are talking about fixing table height for the 1st pages onwards, not for the first page itself, i.e. where the actual report run is returning lines that are less than lines_fixed_per_page. For example, the Invoice run is returning only 5 rows whereas pre-printed stationery has a fixed 30 lines per page. I struggled a lot to get this solution and now I got this and sharing it in this whitepaper.


So far it has not been discovered because of the limitation of for-loop in XSL-FO (XML Technology).Limitation I mean is ,we can not write loop like ‘ for (i=10;i<15 em="" i="" in="" xml.="" xml="">for’

 the loop will always iterate till it gets data, if we want to go beyond that then we can not go. I mean we can write for loop based on data value.

To overcome this problem, I have used the Sub-template concept which I am calling recursively.



Detail Solution

 I am giving this solution for Standard Check Printing Report. The tree structure of data (Sample XML data is as follows).

      -- Top Most root -- Header

      21897

      2205

      

         -- Inner loop - Line Section

          1

          ERS-20-SEP-06-243

        

         -- Inner loop - Line Section

          2

          ERS-20-SEP-06-244

        

      

    


Below is the step-step guide which I follow.


1) Open the Outermost for loop --  G_CHECKS


2) Declare Global Variable called ‘no_of_lines_per_page’  -- In this case I have fixed 40 lines per page.


3) Declare in context variable for the inner group (G_INVOICES), the variable is called ‘inner_group’


4) Open the Inner Loop

   


5) Before putting any elements with the help of the current record pointer 'position()’, I am checking if the current position is modulizing with the no_of_lines_per_page equals zero or not. If it reaches the first record after modulizing then I will create local variable 'first_rec' and initialize it with '0'.


Note : -- Above 3 steps ( 3,4,5) are created under ‘V_inner_group_And_V_First_rec’ form-field. Here there is the limitation of Microsoft word. We can enter up to 138 characters only in the ‘Status’ field of the ‘Add help text’ button. If you want to add more, you can do this by clicking on ‘Help Key’  which is adjacent to the ‘Status’ tab.


6) If the above condition holds true then we will iterate the inner loop.


7) I will check with the help of current record pointer 'position()' that the current record position is either greater than 'first_rec' i.e. the first record or less the 'no_of_lines_per_page' value set up earlier. If it is then show the record otherwise not otherwise it will not go in loop.

   =$first_rec and position()<$first_rec+$no_of_lines_per_page?>


8) Here I am closing the inner for loop and if the condition

   


9) Here I am checking if no_of_lines of the invoice is modulizing with the no_of_lines_per_page equals to zero or not, and at the same time I am checking if $first_rec+$no_of_lines_per_page is greater than no_of_lines of invoice or not. This is an important step for filling the blank rows.

count($inner_group))?>



10) Now I am calling sub-template recursively for filling the blank rows. While calling this template I am passing one parameter which is having a value of no_of_rows to fill. Sub-template will have just a one-row table.


11) Sub-template declaration

   

   

   name="countdown">  

   

   


12) I have created page breaks after the fixed number of rows has been displayed.

   

      page

   


13) Finally closing outer if and inner for loop and outer for loop.

   


No comments:

Post a Comment

Types of animations

Animation is a diverse and creative field with a variety of styles that artists and filmmakers use to bring their visions to life. Here are ...