2016-04-20 10 views
2

JasperReportsを使用してPDFレポートを印刷するときに問題が発生しました。これらのレポートは、基本的に、年間を通して特定のクライアントに行われたすべての販売の内訳です。JRXML - 下のヘッダを削除する

DBから情報を取り出し、Javaを使用して変換し、PDFでレポートを印刷します。 、我々はその緩んヘッダを省略して、新しいページに一つだけを維持することができるはずです、理想的には

enter image description here

:問題は、いくつかのまれなケースでは、いくつかのヘッダは、各ページの下部に繰り返し表示されます少なくともTIBCO Jaspersoft Studioを経由してはやっていないようです。

私は実際にこれらのレポートについて多くのことを知っていませんが、助けが必要な情報は自由にお尋ねください。

ありがとうございます。

EDIT:Petter Fribergのコメントに続いて、このレポートで使用されているJRXMLの部分を示します。私は同じプロパティに続くいくつかの部分を省略しましたが、これは十分に明確でなければならないと思います。

<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="Historique" language="groovy" pageWidth="595" pageHeight="842" columnWidth="483" leftMargin="56" rightMargin="56" topMargin="43" bottomMargin="43" isSummaryWithPageHeaderAndFooter="true" resourceBundle="reportLabels" whenResourceMissingType="Empty" uuid="80db05e1-8ca3-483d-86cc-5947dc62296b"> 
    <property name="ireport.zoom" value="1.0"/> 
    <property name="ireport.x" value="0"/> 
    <property name="ireport.y" value="0"/> 
    <property name="com.jaspersoft.studio.unit." value="pixel"/> 
    <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/> 
    <property name="com.jaspersoft.studio.unit.topMargin" value="mm"/> 
    <property name="com.jaspersoft.studio.unit.bottomMargin" value="mm"/> 
    <property name="com.jaspersoft.studio.unit.leftMargin" value="mm"/> 
    <property name="com.jaspersoft.studio.unit.rightMargin" value="mm"/> 
    <property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/> 
    <property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/> 
    <property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/> 
    <property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/> 
    <template><![CDATA["/jasper/styles_letter.jrtx"]]></template> 
    <style name="Table Group Header" mode="Opaque" forecolor="#000000" backcolor="#99CCFF" vTextAlign="Middle" fontName="Arial" fontSize="10" isBold="true" pdfFontName="Helvetica-Bold"/> 
    <!-- ... multiple styles --> 
    <parameter name="title" class="java.lang.String"/> 
     <!-- ... multiple parameters--> 
    <parameter name="addressCity" class="java.lang.String"/> 
    <field name="reduction" class="java.lang.String"> 
     <fieldDescription><![CDATA[reduction]]></fieldDescription> 
    </field> 
     <!-- ... multiple fields --> 
    <field name="year" class="java.lang.String"/> 
    <group name="DescriptionGroup"> 
     <groupExpression><![CDATA[$F{year}]]></groupExpression> 
     <groupHeader> 
      <band height="30"> 
       <property name="com.jaspersoft.studio.unit.height" value="pixel"/> 
       <textField evaluationTime="Group" evaluationGroup="DescriptionGroup" bookmarkLevel="2"> 
        <reportElement style="Table Group Header" mode="Opaque" x="0" y="0" width="483" height="15" printWhenGroupChanges="DescriptionGroup" backcolor="#B0B0B0" uuid="f626bb36-a919-48b9-98b3-756d1ce9812b"> 
         <property name="local_mesure_unitx" value="pixel"/> 
         <property name="com.jaspersoft.studio.unit.x" value="px"/> 
         <property name="com.jaspersoft.studio.unit.height" value="pixel"/> 
         <printWhenExpression><![CDATA[new Boolean($P{emptyList} != true)]]></printWhenExpression> 
        </reportElement> 
        <box leftPadding="10"> 
         <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> 
         <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> 
         <bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/> 
         <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> 
        </box> 
        <textElement markup="none"> 
         <font size="9" isBold="true"/> 
        </textElement> 
        <textFieldExpression><![CDATA[$F{year}]]></textFieldExpression> 
       </textField> 
       <!-- ... multiple text fields following the same principle --> 
      </band> 
     </groupHeader> 
    </group> 
    <background> 
     <band splitType="Stretch"/> 
    </background> 
    <title> 
     <!-- this only appears in the first page, has all the customer info --> 
    </title> 
    <columnHeader> 
     <band splitType="Stretch"/> 
    </columnHeader> 
    <detail> 
     <band height="25" splitType="Stretch"> 
      <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.HorizontalRowLayout"/> 
      <property name="com.jaspersoft.studio.unit.height" value="pixel"/> 
      <textField pattern="" isBlankWhenNull="true"> 
       <reportElement style="Zebra" mode="Opaque" x="0" y="0" width="130" height="25" uuid="234d3832-bd30-40a0-b8e5-eac964158000"> 
        <property name="local_mesure_unitheight" value="pixel"/> 
        <property name="local_mesure_unitx" value="pixel"/> 
        <property name="com.jaspersoft.studio.unit.x" value="px"/> 
        <property name="com.jaspersoft.studio.unit.height" value="pixel"/> 
        <printWhenExpression><![CDATA[new Boolean($P{emptyList} != true)]]></printWhenExpression> 
       </reportElement> 
       <textElement> 
        <font size="8" isBold="false"/> 
        <paragraph leftIndent="3"/> 
       </textElement> 
       <textFieldExpression><![CDATA[$F{article}]]></textFieldExpression> 
      </textField> 
      <!-- ... multiple fields following the same principle. this is the body of each sub-table, showing the info for each year --> 
     </band> 
    </detail> 
    <pageFooter> 
     <band height="25" splitType="Stretch"> 
      <!-- ... --> 
     </band> 
    </pageFooter> 
    <summary> 
     <band height="40" splitType="Stretch"> 
      <!-- ... shows a summary of all the info shown on each table --> 
     </band> 
    </summary> 
</jasperReport> 

ありがとうございます。

答えて

2

ヘッダーを生成するグループを使用しているため、この属性minHeightToStartNewPageを使用すると、残りのページを新しいページに分割する必要があるかどうかを判断できます。

<group name="DescriptionGroup" minHeightToStartNewPage="60"> 

またはあなたが常に

<group name="DescriptionGroup" isStartNewPage="true"> 
+0

はそんなにありがとう新しいページを開始することを強制したい場合、これは働いていました。 – gilneto8

関連する問題