I'm using RTF template to create a BI report. I need to limit the number of rows into 3 records on the 1st page only. The remaining records/rows will continue to fill the next pages. I'm also required to print the page total. I used the code below to limit the number of records, however it prints only 1 row. Any help will be appreciated. thanks
<?xdoxslt:set_variable($_XDOCTX, ‘counter’, 0)?>
<?xdoxslt:set_variable($_XDOCTX, ‘lines_page’, 3)?>
<?xdoxslt:set_variable($_XDOCTX, ‘tot_lines’, count(.//PdfDraftPurchaseOrderHeaderVORow))?>
<?xdoxslt:set_variable($_XDOCTX,’remainder’,0)?>
<?for-each:PdfDraftPurchaseOrderHeaderVORow?>
<?xdoxslt:set_variable($_XDOCTX, ‘counter’, xdoxslt:get_variable($_XDOCTX, ‘counter’)+1)?>
<?if@row:xdoxslt:get_variable($_XDOCTX,’counter’) != xdoxslt:get_variable($_XDOCTX,’tot_lines’)?>
<?if@row:position() mod xdoxslt:get_variable($_XDOCTX, ‘lines_page’) = 0?><?call:breaking?><?end if?><?end if?>
<?end for-each?>
Try using this within the for-each
I made a simple example and this worked just fine. I got 3 records on the first page, and 6 on the rest.
As for page totals, add this after the element you want to sum, where
TotalFieldNameis the name of the total variable andElementis the XML number element you want to sumAdd this in the footer for the page total, where
TotalFieldNameis the variable we created above, and theNumberFormatis something like 9G999D00