Limiting table rows (BIP)

2019-03-03 22:44发布

问题:

Using RTF and BI Publisher, I have a long table and I want to show only 10 rows on each page. How to do that? As far as I did is:

  1. After grouping defining some variables:

    <?xdoxslt:set_variable($_XDOCTX, ‘counter’, 0)?>
    <?xdoxslt:set_variable($_XDOCTX, ‘lines_page’, 16)?>
    <?xdoxslt:set_variable($_XDOCTX, ‘tot_lines’, count(.//A.U_VATX))?>
    
  2. Inside the cell of first column:

    <?xdoxslt:set_variable($_XDOCTX, ‘counter’,xdoxslt:get_variable($_XDOCTX, ‘counter’)+1)?>
    <?if@inlines:xdoxslt:get_variable($_XDOCTX,’counter’) != xdoxslt:get_variable($_XDOCTX,’tot_lines’)?>
    <?if@inlines:position() mod xdoxslt:get_variable($_XDOCTX, ‘lines_page’) = xdoxslt:get_variable($_XDOCTX,’lines_page’)-1?><?call:footer?><?end if?>
    <?if@inlines:position() mod xdoxslt:get_variable($_XDOCTX, ‘lines_page’) = 0?><?call:breaking?><?end if?><?end if?>
    
  3. After table, defining the templates:

    <?template:footer?>
    table cell with data
    <?end template?>
    <?call-template:footer?>
    <?template:breaking?> 
      table cell empty
      <?split-by-page-break:?> 
      <?end template?>
    
  4. End