2

JasperReportsiReportは初めてです。

それ自体のクエリを保持するメイン レポートと、含める予定のすべてのサブ レポートを作成しました。サブレポートに対するクエリはありません。

メイン レポートにサブ レポートを追加し、メイン レポートから渡されるパラメーターであるデータ ソースを使用するように設定します。

メイン レポートの [詳細] セクションに含めるサブ レポートは、データを表示するためのものです。

メイン レポートを実行すると、サブ レポートが取得され、サブ レポートにデータが渡されて追加されますが、何らかの理由で、サブ レポートのデータ セットから最初の行が削除されます。最終的に、サブレポートの 2 行目からデータを表示し始めます。サブレポートを含めずにフィールドをメインレポートの詳細に直接配置すると、すべての行が表示されます。

両方のレポートの詳細セクションのサイズ/高さと幅を大きくしようとしましたが、それでもサブ レポートの最初の行が削除されます。問題が何であるかを確認するために、次に何を試せばよいかわかりません。

これを機能させるためにサブレポートに設定する必要がある構成はありますか?

メイン レポートの詳細セクション:

<detail>
        <band height="27" splitType="Stretch">
            <textField pattern="R #,##0" isBlankWhenNull="true">
                <reportElement uuid="4171aece-1917-4338-8423-449eecf9dfff" key="textField-2" positionType="Float" mode="Opaque" x="180" y="0" width="88" height="26" forecolor="#000000" backcolor="#FFFFFF"/>
                <box leftPadding="5" rightPadding="5">
                    <topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle" rotation="None">
                    <font fontName="Lucida Sans" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
                    <paragraph lineSpacing="Single"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{Outstanding90}]]></textFieldExpression>
            </textField>
            <textField pattern="R #,##0" isBlankWhenNull="true">
                <reportElement uuid="34e23f8d-2664-47e9-be04-5c1494fbb38a" key="textField-7" positionType="Float" mode="Opaque" x="539" y="0" width="89" height="26" forecolor="#000000" backcolor="#FFFFFF"/>
                <box leftPadding="5" rightPadding="5">
                    <topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle" rotation="None">
                    <font fontName="Lucida Sans" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
                    <paragraph lineSpacing="Single"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{On time}]]></textFieldExpression>
            </textField>
            <textField pattern="R #,##0" isBlankWhenNull="true">
                <reportElement uuid="3f707683-90e2-4c36-bb98-f1d6186687ae" key="textField-5" positionType="Float" mode="Opaque" x="449" y="0" width="89" height="26" forecolor="#000000" backcolor="#FFFFFF"/>
                <box leftPadding="5" rightPadding="5">
                    <topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle" rotation="None">
                    <font fontName="Lucida Sans" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
                    <paragraph lineSpacing="Single"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{Total outstanding}]]></textFieldExpression>
            </textField>
            <textField pattern="R #,##0" isBlankWhenNull="true">
                <reportElement uuid="4b54c6d3-f4e7-4f33-b84b-c4fd73ff4365" key="textField-8" positionType="Float" mode="Opaque" x="719" y="0" width="83" height="26" forecolor="#000000" backcolor="#FFFFFF"/>
                <box leftPadding="5" rightPadding="5">
                    <topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle" rotation="None">
                    <font fontName="Lucida Sans" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
                    <paragraph lineSpacing="Single"/>
                </textElement>
                <textFieldExpression><![CDATA[]]></textFieldExpression>
            </textField>
            <textField pattern="R #,##0" isBlankWhenNull="true">
                <reportElement uuid="fb5afad4-e7c3-43a8-a3e6-e4d380bc5a51" key="textField-3" positionType="Float" mode="Opaque" x="269" y="0" width="89" height="26" forecolor="#000000" backcolor="#FFFFFF"/>
                <box leftPadding="5" rightPadding="5">
                    <topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle" rotation="None">
                    <font fontName="Lucida Sans" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
                    <paragraph lineSpacing="Single"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{Outstanding60}]]></textFieldExpression>
            </textField>
            <textField pattern="R #,##0" isBlankWhenNull="true">
                <reportElement uuid="b4809993-6a3c-42b3-bd14-6a62bac0f489" key="textField-4" positionType="Float" mode="Opaque" x="359" y="0" width="89" height="26" forecolor="#000000" backcolor="#FFFFFF"/>
                <box leftPadding="5" rightPadding="5">
                    <topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle" rotation="None">
                    <font fontName="Lucida Sans" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
                    <paragraph lineSpacing="Single"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{Outstanding30}]]></textFieldExpression>
            </textField>
            <textField pattern="R #,##0" isBlankWhenNull="true">
                <reportElement uuid="903f019a-f45e-4c6d-a580-5045eb8d4671" key="textField-6" positionType="Float" mode="Opaque" x="629" y="0" width="89" height="26" forecolor="#000000" backcolor="#FFFFFF"/>
                <box leftPadding="5" rightPadding="5">
                    <topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle" rotation="None">
                    <font fontName="Lucida Sans" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
                    <paragraph lineSpacing="Single"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{Advance payment}]]></textFieldExpression>
            </textField>
            <textField pattern="R #,##0" isBlankWhenNull="true">
                <reportElement uuid="780255b2-20d0-4e3e-8467-1afc5a234b52" key="textField-2" positionType="Float" mode="Opaque" x="90" y="0" width="89" height="26" forecolor="#000000" backcolor="#FFFFFF"/>
                <box leftPadding="5" rightPadding="5">
                    <topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle" rotation="None">
                    <font fontName="Lucida Sans" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
                    <paragraph lineSpacing="Single"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{Outstanding120}]]></textFieldExpression>
            </textField>
            <textField pattern="" isBlankWhenNull="true">
                <reportElement uuid="e8b6e711-881b-4fe6-be66-445930aa0655" key="textField-1" positionType="Float" mode="Opaque" x="0" y="0" width="89" height="26" forecolor="#000000" backcolor="#FFFFFF"/>
                <box leftPadding="5" rightPadding="1">
                    <topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                </box>
                <textElement textAlignment="Left" verticalAlignment="Middle" rotation="None">
                    <font fontName="Lucida Sans" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
                    <paragraph lineSpacing="Single"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{Status}]]></textFieldExpression>
            </textField>
        </band>
    </detail>

サブレポート:

<?xml version="1.0" encoding="UTF-8"?>
<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="OpsommendeKredietVerslagBedrae" language="groovy" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="eb062df7-cf59-4037-972e-a44f935a83cd">
    <queryString>
        <![CDATA[]]>
    </queryString>
    <field name="Outstanding30" class="java.lang.Double"/>
    <field name="Outstanding60" class="java.lang.Double"/>
    <field name="Outstanding90" class="java.lang.Double"/>
    <field name="Outstanding120" class="java.lang.Double"/>
    <field name="On time" class="java.lang.Double"/>
    <field name="Advance payment" class="java.lang.Double"/>
    <field name="Total outstanding" class="java.lang.Double"/>
    <field name="Status" class="java.lang.String"/>
    <field name="Scheduled payment30" class="java.lang.Double">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="Scheduled payment60" class="java.lang.Double">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="Scheduled payment90" class="java.lang.Double">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="Scheduled payment120" class="java.lang.Double">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <background>
        <band splitType="Stretch"/>
    </background>
    <detail>
        <band height="26" splitType="Stretch">
            <textField pattern="R #,##0" isBlankWhenNull="true">
                <reportElement uuid="903f019a-f45e-4c6d-a580-5045eb8d4671" key="textField-6" positionType="Float" mode="Opaque" x="628" y="0" width="89" height="26" forecolor="#000000" backcolor="#FFFFFF"/>
                <box leftPadding="5" rightPadding="5">
                    <topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle" rotation="None">
                    <font fontName="Lucida Sans" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
                    <paragraph lineSpacing="Single"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{Advance payment}]]></textFieldExpression>
            </textField>
            <textField pattern="R #,##0" isBlankWhenNull="true">
                <reportElement uuid="fb5afad4-e7c3-43a8-a3e6-e4d380bc5a51" key="textField-3" positionType="Float" mode="Opaque" x="269" y="0" width="89" height="26" forecolor="#000000" backcolor="#FFFFFF"/>
                <box leftPadding="5" rightPadding="5">
                    <topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle" rotation="None">
                    <font fontName="Lucida Sans" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
                    <paragraph lineSpacing="Single"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{Outstanding60}]]></textFieldExpression>
            </textField>
            <textField pattern="R #,##0" isBlankWhenNull="true">
                <reportElement uuid="3f707683-90e2-4c36-bb98-f1d6186687ae" key="textField-5" positionType="Float" mode="Opaque" x="448" y="0" width="89" height="26" forecolor="#000000" backcolor="#FFFFFF"/>
                <box leftPadding="5" rightPadding="5">
                    <topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle" rotation="None">
                    <font fontName="Lucida Sans" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
                    <paragraph lineSpacing="Single"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{Total outstanding}]]></textFieldExpression>
            </textField>
            <textField pattern="R #,##0" isBlankWhenNull="true">
                <reportElement uuid="4171aece-1917-4338-8423-449eecf9dfff" key="textField-2" positionType="Float" mode="Opaque" x="180" y="0" width="88" height="26" forecolor="#000000" backcolor="#FFFFFF"/>
                <box leftPadding="5" rightPadding="5">
                    <topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle" rotation="None">
                    <font fontName="Lucida Sans" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
                    <paragraph lineSpacing="Single"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{Outstanding90}]]></textFieldExpression>
            </textField>
            <textField pattern="" isBlankWhenNull="true">
                <reportElement uuid="e8b6e711-881b-4fe6-be66-445930aa0655" key="textField-1" positionType="Float" mode="Opaque" x="0" y="0" width="89" height="26" forecolor="#000000" backcolor="#FFFFFF"/>
                <box leftPadding="5" rightPadding="1">
                    <topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                </box>
                <textElement textAlignment="Left" verticalAlignment="Middle" rotation="None">
                    <font fontName="Lucida Sans" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
                    <paragraph lineSpacing="Single"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{Status}]]></textFieldExpression>
            </textField>
            <textField pattern="R #,##0" isBlankWhenNull="true">
                <reportElement uuid="34e23f8d-2664-47e9-be04-5c1494fbb38a" key="textField-7" positionType="Float" mode="Opaque" x="538" y="0" width="89" height="26" forecolor="#000000" backcolor="#FFFFFF"/>
                <box leftPadding="5" rightPadding="5">
                    <topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle" rotation="None">
                    <font fontName="Lucida Sans" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
                    <paragraph lineSpacing="Single"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{On time}]]></textFieldExpression>
            </textField>
            <textField pattern="R #,##0" isBlankWhenNull="true">
                <reportElement uuid="780255b2-20d0-4e3e-8467-1afc5a234b52" key="textField-2" positionType="Float" mode="Opaque" x="90" y="0" width="89" height="26" forecolor="#000000" backcolor="#FFFFFF"/>
                <box leftPadding="5" rightPadding="5">
                    <topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle" rotation="None">
                    <font fontName="Lucida Sans" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
                    <paragraph lineSpacing="Single"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{Outstanding120}]]></textFieldExpression>
            </textField>
            <textField pattern="R #,##0" isBlankWhenNull="true">
                <reportElement uuid="b4809993-6a3c-42b3-bd14-6a62bac0f489" key="textField-4" positionType="Float" mode="Opaque" x="359" y="0" width="89" height="26" forecolor="#000000" backcolor="#FFFFFF"/>
                <box leftPadding="5" rightPadding="5">
                    <topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle" rotation="None">
                    <font fontName="Lucida Sans" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
                    <paragraph lineSpacing="Single"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{Outstanding30}]]></textFieldExpression>
            </textField>
            <textField pattern="R #,##0" isBlankWhenNull="true">
                <reportElement uuid="4b54c6d3-f4e7-4f33-b84b-c4fd73ff4365" key="textField-8" positionType="Float" mode="Opaque" x="717" y="0" width="90" height="26" forecolor="#000000" backcolor="#FFFFFF"/>
                <box leftPadding="5" rightPadding="5">
                    <topPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle" rotation="None">
                    <font fontName="Lucida Sans" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
                    <paragraph lineSpacing="Single"/>
                </textElement>
                <textFieldExpression><![CDATA[]]></textFieldExpression>
            </textField>
        </band>
    </detail>
</jasperReport>
4

2 に答える 2

1

やっと答えが出ました。

私が必要としていたの$P{REPORT_CONNECTION}は、サブレポートに を渡すことでした。これは、各レポートが独自のクエリを持つことができることを意味します。メインおよびすべてのサブ レポート

手順:

  1. 自分のメイン レポート自体にクエリを実行する
  2. パレットからドラッグして、サブレポートを作成します。
  3. サブレポートのプロパティについて。使用接続式の設定
  4. サブレポートのプロパティについて。使用$P{REPORT_CONNECTION}
  5. メイン レポートからサブ レポートを開きます。つまり、メイン レポートのサブ レポート タグを右クリックし、[サブ レポートを開く] をクリックします。何らかの理由でこれを行ったときに同じサブレポートを開きましたが、個別に開いたときに行った変更は表示されませんでした。このように開いたものに変更を加えた後、すべて100%機能したため、ここで変更が行われたと思います。

ご提案いただきありがとうございます

于 2013-10-21T16:40:27.403 に答える
1

このトピックについて詳しく説明すると、JavaBeanCollectionDataSource で同じ問題が発生しました。多くのサブレポートを含むマスター レポートがあり、すべてのサブレポートにマスター データソースを提供したいと考えていました。すべてのサブレポートでデータソース式として使用する$P{REPORT_DATA_SOURCE}と、最初のサブレポートのみが表示されます (マスター レポートが最初の行を消費したため、最初の行も失われます)。

解決策: サブレポートごとにデータソースの新しいインスタンスが必要です

方法: 入力中に、サブレポートごとにデータセットの複製されたインスタンスを追加します。例えば:

Map parameters = new HashMap();
parameters.put("MasterDataSourceInstance_1", beanColDataSource.cloneDataSource());
parameters.put("MasterDataSourceInstance_2", beanColDataSource.cloneDataSource());

レポート ファイル内:

<parameter name="MasterDataSource_1" class="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"/>
<parameter name="MasterDataSource_2" class="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"/>

これで、(使用ごとに 1 回だけ) データソース インスタンスを使用できます。

<dataSourceExpression><![CDATA[$P{MasterDataSource_1}]]></dataSourceExpression>
于 2016-08-03T11:31:16.950 に答える