いくつかのサブレポートを含むレポートがあります。
報告する:
Sub-Report
Sub-Report
それらを少し分けるために、サブレポートのすべてのデータをフレームで囲みます。
サブレポート:
Column Header:
- Frame (left,top,right)
Group Header 1:
- Headings of data
Detail 1:
- data
- Frame (left,right)
Group Footer 1:
- summary of data
- Frame (left,right)
Column Footer:
- Frame (left,bottom,right)
したがって、側面の残りの場所が十分に大きくない場合は、列のヘッダーとフッターが表示されます。
->それを回避する方法は?
ページの状況:
Column Header
Group Header 1
Detail 1
Group Footer 1
Column Footer
Column Header
-nothing else here-
Column Footer
-- next page --
Column Header
Group Header 1
Detail 1
Group Footer 1
Column Footer
私がページに欲しいもの:
Column Header
Group Header 1
Detail 1
Group Footer 1
Column Footer
-- next page --
Column Header
Group Header 1
Detail 1
Group Footer 1
Column Footer
ところで:私はまた、列の代わりにページヘッダー/フッターを使用してみました。しかし、それもうまくいきませんでした。また、グループヘッダー/フッターにもフレームを配置しましたが、この場合、データに複数のページが必要な場合、ページ下部にフレームがないため、グループフッターがグループの最後にあります。
言い換えれば、データの詳細がある場合は、列/ページのフッター/ヘッダーのみが表示されます-データが表示されているバンド。
私のjrxmlファイル:
<?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="Subreport" pageWidth="566" pageHeight="842" columnWidth="566" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" resourceBundle="ReportResources" whenResourceMissingType="Key">
<parameter name="JasperReportParm.FromMaster.PK" class="java.lang.Long"/>
<parameter name="JasperReportParm.FromMaster.Name" class="java.lang.String"/>
<parameter name="JasperReportParm.FromMaster.Datum" class="java.lang.String"/>
<queryString>
<![CDATA[SELECT * FROM ...]]>
</queryString>
<field name="PK" class="java.lang.Long">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="PK1" class="java.lang.Long">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="ZahlFormatted" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="zebra" class="java.lang.Boolean">
<fieldDescription><![CDATA[false]]></fieldDescription>
</field>
<group name="FramesTopBottom" isReprintHeaderOnEachPage="true" minHeightToStartNewPage="79">
<groupExpression><![CDATA[]]></groupExpression>
<groupHeader>
<band height="2"/>
</groupHeader>
<groupFooter>
<band/>
</groupFooter>
</group>
<group name="PK1" isReprintHeaderOnEachPage="true" minHeightToStartNewPage="40">
<groupExpression><![CDATA[$F{PK1}]]></groupExpression>
<groupHeader>
<band height="29">
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToTallestObject" x="487" y="6" width="74" height="10"/>
<textElement textAlignment="Right">
<font fontName="Helvetica" size="9" isItalic="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{JasperReportParm.FromMaster.Datum}]]></textFieldExpression>
</textField>
<rectangle>
<reportElement x="0" y="17" width="566" height="9" backcolor="#AFD9FF"/>
<graphicElement>
<pen lineWidth="0.0"/>
</graphicElement>
</rectangle>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement key="4" x="5" y="18" width="52" height="9"/>
<box>
<topPen lineWidth="0.0" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineColor="#000000"/>
</box>
<textElement>
<font fontName="Helvetica" size="7" isBold="false"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$R{Global.Datum}]]></textFieldExpression>
</textField>
<frame>
<reportElement x="0" y="0" width="566" height="29"/>
<box>
<pen lineWidth="0.1" lineColor="#000000"/>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.1" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.1" lineStyle="Solid" lineColor="#000000"/>
</box>
</frame>
</band>
</groupHeader>
<groupFooter>
<band height="24">
<line>
<reportElement x="495" y="3" width="67" height="1" forecolor="#999999"/>
<graphicElement>
<pen lineWidth="0.1" lineStyle="Solid" lineColor="#000000"/>
</graphicElement>
</line>
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToTallestObject" x="496" y="7" width="65" height="10"/>
<textElement textAlignment="Right">
<font fontName="Helvetica" size="9" isBold="true" isItalic="false" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{ZahlFormatted}]]></textFieldExpression>
</textField>
<frame>
<reportElement x="0" y="0" width="566" height="24"/>
<box>
<pen lineWidth="0.1" lineColor="#000000"/>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.1" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.1" lineStyle="Solid" lineColor="#000000"/>
</box>
</frame>
</band>
</groupFooter>
</group>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band splitType="Stretch"/>
</title>
<pageHeader>
<band splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band height="8" splitType="Stretch">
<frame>
<reportElement x="0" y="0" width="566" height="2"/>
<box>
<pen lineWidth="0.1" lineColor="#000000"/>
<topPen lineWidth="0.1" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.1" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.1" lineStyle="Solid" lineColor="#000000"/>
</box>
</frame>
</band>
</columnHeader>
<detail>
<band height="11" splitType="Stretch">
<rectangle>
<reportElement key="2" stretchType="RelativeToBandHeight" mode="Opaque" x="0" y="0" width="566" height="11" isPrintWhenDetailOverflows="true" backcolor="#ECF4FF">
<printWhenExpression><![CDATA[$F{zebra}]]></printWhenExpression>
</reportElement>
<graphicElement>
<pen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</graphicElement>
</rectangle>
<frame>
<reportElement x="0" y="0" width="566" height="11"/>
<box>
<pen lineWidth="0.1" lineColor="#000000"/>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.1" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.1" lineStyle="Solid" lineColor="#000000"/>
</box>
</frame>
</band>
</detail>
<columnFooter>
<band height="8" splitType="Stretch">
<frame>
<reportElement x="0" y="0" width="566" height="8"/>
<box>
<pen lineWidth="0.1" lineColor="#000000"/>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.1" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.1" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.1" lineStyle="Solid" lineColor="#000000"/>
</box>
</frame>
</band>
</columnFooter>
<pageFooter>
<band splitType="Stretch"/>
</pageFooter>
<summary>
<band splitType="Stretch"/>
</summary>
</jasperReport>