在 JasperReports(使用 Jaspersoft Studio)中,有没有办法显示内容而不包括总数?

我这里有交叉表代码。如果我删除出现 <crosstabTotalRowHeader><crosstabTotalColumnHeader> 的行,交叉表会继续显示总计列,即没有标题的列。我需要删除该列。

<crosstab>
    <reportElement x="0" y="0" width="442" height="240" uuid="aae99187-4857-48ad-b2c6-6a66c5e6e89a"/>
    <crosstabDataset>
        <dataset>
            <datasetRun subDataset="grafica_perspectiva" uuid="a819174c-e145-4ad4-a3ef-cddde875ceab">
                <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
            </datasetRun>
        </dataset>
    </crosstabDataset>
    <rowGroup name="perspectiva1" width="60" totalPosition="End">
        <bucket class="java.lang.String">
            <bucketExpression><![CDATA[$F{perspectiva}]]></bucketExpression>
        </bucket>
        <crosstabRowHeader>
            <cellContents mode="Opaque" style="Crosstab_CH">
                <textField>
                    <reportElement x="0" y="0" width="60" height="20" forecolor="#FFFFFF"
                                   uuid="ff8ba239-2c96-4959-8d57-5751f1e67ce1"/>
                    <textFieldExpression><![CDATA[$V{perspectiva1}]]></textFieldExpression>
                </textField>
            </cellContents>
        </crosstabRowHeader>
        <crosstabTotalRowHeader>
            <cellContents/>
        </crosstabTotalRowHeader>
    </rowGroup>
    <columnGroup name="cot_nombre1" height="30" totalPosition="End">
        <bucket class="java.lang.String">
            <bucketExpression><![CDATA[$F{cot_nombre}]]></bucketExpression>
        </bucket>
        <crosstabColumnHeader>
            <cellContents mode="Opaque" style="Crosstab_CH">
                <textField>
                    <reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="140" height="30"
                                   forecolor="#FFFFFF" uuid="76a9a21c-efed-4164-ab6c-4f91e2bf3903"/>
                    <textFieldExpression><![CDATA[$V{cot_nombre1}]]></textFieldExpression>
                </textField>
            </cellContents>
        </crosstabColumnHeader>
        <crosstabTotalColumnHeader>
            <cellContents/>
        </crosstabTotalColumnHeader>
    </columnGroup>
    <measure name="promedio_MEASURE1" class="java.lang.String">
        <measureExpression><![CDATA[new DecimalFormat("###0.00").format($F{promedio})]]></measureExpression>
    </measure>
    <crosstabCell width="140" height="20">
        <cellContents mode="Opaque" style="Crosstab_CD">
            <textField>
                <reportElement x="0" y="0" width="140" height="20" uuid="66c4a20e-d1d2-4263-8a1a-19b09f5d93fd"/>
                <textFieldExpression><![CDATA[$V{promedio_MEASURE1}]]></textFieldExpression>
            </textField>
        </cellContents>
    </crosstabCell>
    <crosstabCell width="140" height="20" rowTotalGroup="perspectiva1">
        <cellContents mode="Opaque" style="Crosstab_CD">
            <box>
                <topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
            </box>
        </cellContents>
    </crosstabCell>
</crosstab>

最佳答案

没关系。为防止在交叉表中显示总计列/行,请确保 columnGroup/rowGroup 中的 totalPosition 属性等于 None。

关于jasper-reports - 没有总计的交叉表,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/22568709/

10-11 07:12