-----Google Analytics Code Start----> <-----Google Analytics Code Close---->
|Receive Email for New Articles|
|XML Publisher - Developing reports printed on Pre-Printed Stationary||| Print ||
|Written by Anil Passi|
|Thursday, 07 June 2007|
I am pleased to introduce to you Mr Darshan Bhavsar. Darshan is a Senior Technical Oracle Applications Consultant and amongst many things, he specializes in XML Publisher.
In this article, he will explain the steps to implement XML Publisher reports for Pre-Printed Stationary in Oracle eBusiness Suite.
The article below is from Mr Darshan Bhavsar.
The Sample Template and Data file can be downloaded from the end of this article.
I was inspired to come up with this because I feel that lots of people want this solution and they are struggling to implement this.
In this whitepaper, I am going to explain the approach which I used for developing pre-printed stationary reports by XML publisher’s RTF method. This approach I used for 2 customers and it works absolutely fine. They are very happy. Example Pre-Printed stationary reports which I worked on are following ‘AP Check Printing(Bank)’ ,’AR invoice Printing’,’PO purchase Order Printing’ …. etc….
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. Detail section table should always have fix table height, in the sense it should always have fix number of rows in the table no matter how many rows returned by actual report run. For example Invoice stationary has fix 30 rows in line detail table, and Actual report run is returning only 5 rows then rest 25 blank rows should be generatedprogrammatically.
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;i++)’ in XML. In XML ‘for’ 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 Sub-template concept which I am calling recursively.
I am giving this solution for Standard Check Printing Report. Tree structure of data (Sample XML data is as follow).
<G_CHECKS> -- Top Most root -- Header
<G_INVOICES> -- Inner loop - Line Section
<G_INVOICES> -- Inner loop - Line Section
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.
<xsl:variable name="no_of_lines_per_page" select="number(40)"/>
3) Declare incontext variable for inner group (G_INVOICES), variable is called ‘inner_group’
<xsl:variable xdofo:ctx="incontext" name="inner_group” select=".//G_INVOICES"/>
4) Open the Inner Loop
5) Before putting any elements with the help of 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'.
<?if:(position()-1) mod $no_of_lines_per_page=0?><xsl:variable name="first_rec" xdofo:ctx="incontext" select="position()"/>
Note : -- Above 3 steps ( 3,4,5) are created under ‘V_inner_group_And_V_First_rec’ form-field. Here there is limitation of Microsoft-word. We can enter upto 138 characters only in ‘Status’ field of ‘Add help text’ button.If you want to add more , you can do this by clicking on ‘Help Key’ which is adjacent to ‘Status’ tab.
6) If 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.
<?if:position()>=$first_rec and position()<$first_rec+$no_of_lines_per_page?>
8) Here I am closing the inner for loop and if condition
<?end if?><?end for-each?>
9) Here I am checking if no_of_lines of invoice is modulizing with the no_of_lines_per_page equals to zero or not ,and 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 important step for filling the blank rows.
<?if:not(count($inner_group) mod $no_of_lines_per_page=0) and ($first_rec+$no_of_lines_per_page>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 value of no_of_rows to fill. Sub-template will have just one row table.
<xsl:call-template xdofo:ctx="inline" name="countdown"><xsl:with-param name="countdown" select="$no_of_lines_per_page - (count($inner_group) mod $no_of_lines_per_page)"/></xsl:call-template>
11) Sub-template declaration
<xsl:param name="countdown"/><xsl:if test="$countdown"><xsl:call-template
name="countdown"><xsl:with-param name="countdown" select="$countdown - 1"/>
12) I have created page break after the fixed number of rows have been displayed.
<xsl:if xdofo:ctx="inblock" test="$first_rec+$no_of_lines_per_page<=count($inner_group)">
13) Finally closing outer if and inner for loop and outer for loop.
<?end if?><?end for-each?><?end for-each?>
If you want more information then please contact me on Darshan.email@example.com
written by pandit , June 09, 2007
written by Dhaval Rathod , June 09, 2007
written by Anil Passi , June 15, 2007
written by uma , June 18, 2007
written by Baji , June 25, 2007
written by Anil Passi , June 25, 2007
written by Jay , June 27, 2007
written by Anil Passi , June 27, 2007
written by Anil Passi , July 02, 2007
Issuewhen the output type is RTF
written by cma , July 03, 2007
written by cma , July 04, 2007
written by APassi , July 10, 2007
written by Joy , August 02, 2007
written by pp , August 07, 2007
written by madhavi , August 10, 2007
written by Ashi0407 , August 13, 2007
written by Yuvaraj , August 13, 2007
written by vsrao , August 13, 2007
written by NaveenK , August 14, 2007
written by NaveenK , August 17, 2007
written by Anupama C , August 21, 2007
written by krishna kishore , August 27, 2007
written by shank , August 28, 2007
written by Madhukar , August 30, 2007
written by shank , August 31, 2007
written by raj naik , September 02, 2007
written by Amitav , September 10, 2007
written by Diane , September 12, 2007
written by Madhukar , September 13, 2007
written by Geetha24 , September 14, 2007
written by we , September 24, 2007
written by kumar v , September 24, 2007
Multiple Layouts in a single RTF and each layout in the RTF opening in a new or Seperate PDF or EXCEL
written by Mohammad Rafi.Shaik , November 07, 2007
written by Kalyani , November 08, 2007
Dynamically choosing Layout
written by punit , November 12, 2007
written by JaxDan , November 13, 2007
spting xml insted of pdf - soulution
written by Veena Shetty , November 15, 2007
AR Invoice Lines Issue
written by prabu , November 22, 2007
written by Sumit , November 22, 2007
written by jagadish , November 28, 2007
page totals in xml reports
written by srinivas , November 30, 2007
written by Wazid , December 04, 2007
hi i want XML reports tutorial notes from scrach onwords
written by Arun Kumar , December 23, 2007
Oracle Report to XML Publisher conversion - Lexical parameter & Format trigger handling
written by Mani , December 28, 2007
Issue with fixed number of lines
written by SureshV , February 06, 2008
If lentgh of a line is not fixed for a table
written by navneet , February 13, 2008
written by Sultan , February 15, 2008
Two RTF for AR Invoice Print (US and Dutch)
written by Manuami , February 18, 2008
Two RTF for AR Invoice Print (US and Dutch) -- Cont
written by Manuami , February 18, 2008
AR Invoice Print
written by Jesus Castillo , February 20, 2008
Not printing page number correctly when running from apps
written by Peter , March 03, 2008
How to design the template
written by Ramkumar , March 12, 2008