Serial number printing on jasper report detail
I created a jasper report. This report details the serialNumber column. This column wants to be auto-incremented, and the statistics with "1". I am using hibernate
to request. Sample code:
<detail>
<band height="17" splitType="Stretch">
<textField isBlankWhenNull="true">
<reportElement x="12" y="0" width="27" height="15"/>
<textElement/>
<textFieldExpression class="java.lang.Integer"><![CDATA[serialNumber]]>
</textFieldExpression>
</textField>
<textField>
<reportElement x="51" y="0" width="37" height="15"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{date}]]>
</textFieldExpression>
</textField>
<textField>
<reportElement x="138" y="0" width="75" height="15"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{time}]]>
</textFieldExpression>
</textField>
</band>
</detail>
Can anyone help to print the serial number in the jasper report.
+2
source to share
4 answers
You can use an alternative solution for this problem, which is created in the $ V {REPORT_COUNT} variable.
This variable will return the number of lines in Integer format.
Expression example:
<textFieldExpression class="java.lang.Integer"><![CDATA[$V{REPORT_COUNT}]]></textFieldExpression>.
+1
source to share