To display the brought forward total at the top of each page (except the first), use the
following syntax:
name="InvAmt">
Brought Forward:
format="99G999G999D00"/>
The following table describes the elements comprising the brought forward syntax:
Complex Headers and Footers, page 2-16 for details.
Place the carried forward object at the bottom of your template where you want the
total to display. The carried forward object for our example is as follows:
name="InvAmt">
Carried Forward:
format="99G999G999D00"/>
Note the following differences with the brought-forward object:
• The display-condition is set to exceptlast so that the carried forward total
will display on every page except the last page.
• The display string is "Carried Forward".
• The show-carry-forward element is used to show the carried forward value. It
has the same properties as brought-carried-forward, described above.
You are not limited to a single value in your template, you can create multiple brought
forward/carried forward objects in your template pointing to various numeric elements
in your data.
Running Totals
Example
To create the Running Total field, define a variable to track the total and initialize it to 0.
The template is shown in the following figure:
The values for the form fields in the template are shown in the following table:
Form Field Syntax Description
RtotalVar CTX, 'RTotalVar', 0)?>
Declares the "RTotalVar"
variable and initializes it to 0.
FE Starts the Invoice group.
10001-1 Invoice Number tag
1-Jan-2005 Invoice Date tag
100.00 CTX, 'RTotalVar',
xdoxslt:get_variable($_XDOC
TX, 'RTotalVar') +
INVAMT)?>
xdoxslt:get_variable($_XDOC
TX, 'RTotalVar')?>
Sets the value of RTotalVar to
the current value plus the
new Invoice Amount.
Retrieves the RTotalVar value
for display.
EFE Ends the INVOICE group.
Many reports require that a page total be maintained throughout the report output and
be displayed at the beginning and end of each page. These totals are known as "brought
forward/carried forward" totals.
Note: The totaling for the brought forward and carried forward fields is
performed in the PDF-formatting layer. Therefore this feature is not
available for other outputs types: HTML, RTF, Excel.
An example is displayed in the following figure:
At the end of the first page, the page total for the Amount element is displayed as the
Carried Forward total. At the top of the second page, this value is displayed as the
Brought Forward total from the previous page. At the bottom of the second page, the
brought forward value plus the total for that page is calculated and displayed as the
new Carried Forward value, and this continues throughout the report.
This functionality is an extension of the Page Totals, page 2-74 feature. The following
example walks through the syntax and setup required to display the brought forward
and carried forward totals in your published report.
Field Form Field Help Text Entry Description
Init PTs Declares "InvAmt" as the placeholder that
will hold the page total.
FE Begins the INVOICE group.
10001-1 Placeholder for the Invoice Number tag.
1-Jan-2005 Placeholder for the Invoice Date tag.
100.00 Placeholder for the Invoice Amount tag.
InvAmt Assigns the "InvAmt" page total object to
the INVAMT element in the data.
EFE Closes the INVOICE group.
End PTs Closes the "InvAmt" page total.
To display the brought forward total at the top of each page (except the first), use the
following syntax:
name="InvAmt">
Brought Forward:
format="99G999G999D00"/>
The following table describes the elements comprising the brought forward syntax:
Hi Ravi,
ReplyDeleteGreat & useful article. It's very informative for Oracle apps Developers.
Thanks
Prashanta