我是JasperReports和iReport的新手。
我创建了一个主报表,其中包含自己的查询以及我将要包含的所有子报表。没有对任何子报告的查询。
我正在向主报告添加一个子报告并将其设置为使用数据源,该数据源是从主报告传递的参数。
我包含在主报告的详细信息部分中的子报告,因为它将显示数据。
当我运行主报表时,它会获取子报表,将数据传递并添加到子报表中,但由于某种原因,它会从子报表中的数据集中删除第一行。所以最后它开始显示子报告中第二行的数据。当我不包含子报表并将字段直接放入主报表的详细信息时,它会显示所有行。
我已经尝试增加两个报告详细信息部分的大小/高度和宽度,但它仍然删除了子报告中的第一行。我不知道接下来要尝试什么,看看可能是什么问题。
是否需要为子报告设置配置才能使其正常工作?
主要报告详细信息部分:
<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>