title: Jasper Reports: Page Number inside subreport does not work
body: <p>I have several similar reports in my application, for this reason I have created a basic structure with a subreport inside the Title and another one inside the Page Footer.</p>
  
  <p>The problem is that I have 70 similar reports and if one day I need to change the footer structure I don´t wanna have to change 70 reports I prefer change only one. </p>
  
  <p>In the footer subreport I have this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="reportFooterV" pageWidth="550" pageHeight="650" orientation="Landscape" whenNoDataType="AllSectionsNoDetail" columnWidth="550" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="6a63a92f-0859-4b0b-84b8-6166c2fe0951"&gt;
      &lt;property name="ireport.zoom" value="1.5"/&gt;
      &lt;property name="ireport.x" value="19"/&gt;
      &lt;property name="ireport.y" value="0"/&gt;
      &lt;parameter name="date" class="java.lang.String" isForPrompting="false"/&gt;
      &lt;title&gt;
          &lt;band height="19"&gt;
              &lt;textField&gt;
                  &lt;reportElement uuid="89a04d3d-73e0-4f28-9747-3206c4022769" x="0" y="0" width="191" height="19" forecolor="#999999"/&gt;
                  &lt;textElement verticalAlignment="Bottom"&gt;
                      &lt;font fontName="Roboto" size="10" isBold="false"/&gt;
                  &lt;/textElement&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$P{date}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField evaluationTime="Auto"&gt;
                  &lt;reportElement uuid="89a04d3d-73e0-4f28-9747-3206c4022769" x="352" y="0" width="99" height="19" forecolor="#999999"/&gt;
                  &lt;textElement textAlignment="Right" verticalAlignment="Bottom"&gt;
                      &lt;font fontName="Roboto" size="10" isBold="false"/&gt;
                  &lt;/textElement&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$V{PAGE_NUMBER}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
          &lt;/band&gt;
      &lt;/title&gt;
  &lt;/jasperReport&gt;
  </code></pre>
  
  <p>But the variable PAGE_NUMBER, doesnt work and always show 1 in the page.</p>
  
  <p>In the main report I have this in the pageFooter area</p>
  
  <pre><code>&lt;jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="systemParametersSummary" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" resourceBundle="properties.Messages" isIgnorePagination="true" uuid="6a63a92f-0859-4b0b-84b8-6166c2fe0951"&gt;
  
  ....
      &lt;pageFooter&gt;
          &lt;band height="22"&gt;
              &lt;subreport&gt;
                  &lt;reportElement uuid="ac3cfc74-4e5a-45bc-945a-7ca6c82c4f6a" x="2" y="0" width="150" height="22"/&gt;
                  &lt;subreportParameter name="date"&gt;
                      &lt;subreportParameterExpression&gt;&lt;![CDATA[$P{date}]]&gt;&lt;/subreportParameterExpression&gt;
                  &lt;/subreportParameter&gt;
                  &lt;subreportExpression&gt;&lt;![CDATA[$P{footer}]]&gt;&lt;/subreportExpression&gt;
              &lt;/subreport&gt;
          &lt;/band&gt;
      &lt;/pageFooter&gt;
  &lt;/jasperReport&gt;
  </code></pre>
  
  <p>I dont know why I cant find the workaround for this, if anyone can help me...thank you!</p>