title: How to recalculate page number when combining multiple jasper reports in export?
body: <p><em>I have decided to pass this Q/A after receiving both questions in chat and <a href="https://stackoverflow.com/questions/24115885/combining-two-jasper-reports/34580248?noredirect=1#comment71989189_34580248">comment</a> on answer on how to handle page number in "combined" jasper reports</em></p>
  
  <p>When combining reports in java using</p>
  
  <pre><code>JasperPrint jasperPrint1 = JasperFillManager.fillReport(report1, paramMap);
  JasperPrint jasperPrint2 = JasperFillManager.fillReport(report2, paramMap);
  List&lt;JasperPrint&gt; jasperPrintList = Arrays.asList(jasperPrint1, jasperPrint2); 
  
  JRPdfExporter exporter = new JRPdfExporter();
  exporter.setExporterInput(SimpleExporterInput.getInstance(jasperPrintList));
  </code></pre>
  
  <p>The page number and total page number</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;textField&gt;
      &lt;reportElement x="435" y="30" width="80" height="20" uuid="14bad2ac-3a56-4cf4-b4dd-310b8fcd2120"/&gt;
      &lt;textElement textAlignment="Right"/&gt;
      &lt;textFieldExpression&gt;&lt;![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]&gt;&lt;/textFieldExpression&gt;
  &lt;/textField&gt;
  &lt;textField evaluationTime="Report"&gt;
          &lt;reportElement x="515" y="30" width="40" height="20" uuid="06567ba6-6243-43e9-9813-f6593528524c"/&gt;
          &lt;textFieldExpression&gt;&lt;![CDATA[" " + $V{PAGE_NUMBER}]]&gt;&lt;/textFieldExpression&gt;
  &lt;/textField&gt;
  </code></pre>
  
  <p>Is always restarted for each report that I'm including in list, is there a way that I can recalculate these?</p>
  
  <p>I want to have on each page the current page (and correct total number of pages) considering my final combined report.</p>