在ireport中设置$V{PAGE_NUMBER},为什么编译不过去呢?这个应该放在什么位置,不是pageHeader吗?急求!谢谢各位专家了!

解决方案 »

  1.   

    应该是放在pageFooter中的吧
      

  2.   

    自己参考下:
    <pageFooter>
    <band height="20"  isSplitAllowed="true" >
    <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
    <reportElement
    x="433"
    y="0"
    width="20"
    height="20"
    key="textField"/>
    <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
    <textElement textAlignment="Center" verticalAlignment="Middle">
    <font reportFont="tilte"/>
    </textElement>
    <textFieldExpression   class="java.lang.Integer"><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
    </textField>
    <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Report" hyperlinkType="None"  hyperlinkTarget="Self" >
    <reportElement
    x="465"
    y="0"
    width="20"
    height="20"
    key="textField"/>
    <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
    <textElement textAlignment="Center" verticalAlignment="Middle">
    <font reportFont="tilte"/>
    </textElement>
    <textFieldExpression   class="java.lang.Integer"><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
    </textField>
    <staticText>
    <reportElement
    x="453"
    y="0"
    width="10"
    height="20"
    key="staticText-30"/>
    <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
    <textElement textAlignment="Center" verticalAlignment="Middle">
    <font reportFont="tilte"/>
    </textElement>
    <text><![CDATA[/]]></text>
    </staticText>
    </band>
    </pageFooter>