Wednesday, April 18, 2012

Page Totals

Page totaling is performed in the PDF-formatting layer. Therefore this feature is not available for other outputs types: HTML, RTF, Excel.

Because the page total field does not exist in the XML input data, you must define a variable to hold the value. When you define the variable, you associate it with the element from the XML file that is to be totaled for the page. Once you define total fields, you can also perform additional functions on the data in those fields.

To declare the variable that is to hold your page total, insert the following syntax immediately following the placeholder for the element that is to be totaled:
<?add-page-total:TotalFieldName;'element'?>
where
TotalFieldName is the name you assign to your total (to reference later) and 'element' is the XML element field to be totaled. You can add this syntax to as many fields as you want to total.

Then when you want to display the total field, enter the following syntax:
<?show-page-total:TotalFieldName;'number-format'?>
where
TotalFieldName is the name you assigned to give the page total field above and number-format is the format you wish to use to for the display.

Example:
 
Sample Files:
RTF:PageTotal.rtf
XML:EmployeeListing.xml
Related Posts Plugin for WordPress, Blogger...