我使用了$V{REPORT_COUNT}来显示RECORDS.For的序列号,从数据库中获取的每条记录都正确显示了序列号。
但是,如果打印的一条记录的数据量超过了一页所能容纳的数据量,则该记录将显示在下一页上。我也很好,但是序列号再次显示为该页,例如。3是序列号,如果3不能在同一页上容纳,则将记录写入下一页,并且序列号的顺序是1、2、3(第一页)、3、4、5等等(第二页)。
我希望3只在第一页显示一次,而不是在第二页。我已经上传了我的布局的图像,我不想显示带圈的部分

我正在使用Ireport设计页面
文本字段属性这是用于REPORT_COUNT文本文件的
<reportElement
mode="Opaque"
x="0"
y="0"
width="15"
height="30"
backcolor="#D3D3D3"
key="textField-9"
stretchType="RelativeToBandHeight"
positionType="Float"
isPrintRepeatedValues="false"
isRemoveLineWhenBlank="true"
isPrintWhenDetailOverflows="true"/>
<box topBorder="Thin" topBorderColor="#000000" leftBorder="Thin" leftBorderColor="#000000" rightBorder="Thin" rightBorderColor="#000000" bottomBorder="Thin" bottomBorderColor="#000000"/>
<textElement textAlignment="Center" verticalAlignment="Top">
<font fontName="Times New Roman" pdfFontName="Times-Bold" size="10" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Integer"><![CDATA[$V{REPORT_COUNT}]]></textFieldExpression>
</textField>显示数据的右侧文本框的以下属性:
<textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
mode="Opaque"
x="12"
y="0"
width="523"
height="13"
forecolor="#000000"
backcolor="#D3D3D3"
key="textField-2"
positionType="Float"
isRemoveLineWhenBlank="true"/>
<box topBorder="Thin" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="Thin" rightBorderColor="#000000" bottomBorder="Thin" bottomBorderColor="#000000"/>
<textElement verticalAlignment="Middle">
<font fontName="SansSerif" pdfFontName="Times-Bold" size="8" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[" "+$F{vesselName}+($F{type} == null ? "" : " ("+$F{type}+")")]]></textFieldExpression>
</textField>发布于 2015-08-17 22:00:34
为您的变量设置一些属性:
<variable name="RECORD_COUNT" class="java.lang.String" incrementType="Column" calculation="Count">
<initialValueExpression><![CDATA[1]]></initialValueExpression>
</variable>发布于 2015-08-17 23:32:08
您能告诉我们您为文本字段设置的属性吗?
我刚刚粗略地设计了你的场景,我没有遇到你的问题。row_count值不重复。
请参阅下图。

https://stackoverflow.com/questions/32051829
复制相似问题