title: Limiting lines per page in BI Publisher
body: <p>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</p>
  
  <pre><code>&lt;?xdoxslt:set_variable($_XDOCTX, ‘counter’, 0)?&gt;
  &lt;?xdoxslt:set_variable($_XDOCTX, ‘lines_page’, 3)?&gt;
  &lt;?xdoxslt:set_variable($_XDOCTX, ‘tot_lines’, count(.//PdfDraftPurchaseOrderHeaderVORow))?&gt; 
  &lt;?xdoxslt:set_variable($_XDOCTX,’remainder’,0)?&gt;
  
  &lt;?for-each:PdfDraftPurchaseOrderHeaderVORow?&gt;
  &lt;?xdoxslt:set_variable($_XDOCTX, ‘counter’, xdoxslt:get_variable($_XDOCTX, ‘counter’)+1)?&gt;
  &lt;?if@row:xdoxslt:get_variable($_XDOCTX,’counter’) != xdoxslt:get_variable($_XDOCTX,’tot_lines’)?&gt;
  &lt;?if@row:position() mod xdoxslt:get_variable($_XDOCTX, ‘lines_page’) = 0?&gt;&lt;?call:breaking?&gt;&lt;?end if?&gt;&lt;?end if?&gt;
  &lt;?end for-each?&gt;
  </code></pre>