碧玉报告表列溢出

时间:2018-11-04 02:34:59

标签: jasper-reports

我正在使用jasper报告6.7.0生成pdf。

我的详细信息带只有一个表格,我为每个列单元格检查stretch with overflow。我的pdf看起来像:

enter image description here

我的某些列可能包含很多内容,例如列Nature of Goods,现在看起来就像上面的屏幕截图。

其内容延伸到页面2,但是其他列的第一行仍在页面1中,而页面2仅包含延伸内容,第二行数据将显示在页面3上。

这看起来很丑。我该如何解决这个问题?

我的详细信息带来源是:

<detail>
 <band height="251" splitType="Stretch">
  <componentElement>
   <reportElement x="2" y="0" width="840" height="251" uuid="232b5287-f0ec-491c-9bcd-a884bd1c5e9d">
    <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
    <property name="com.jaspersoft.studio.table.style.table_header" value="Table_TH"/>
    <property name="com.jaspersoft.studio.table.style.column_header" value="Table_CH"/>
    <property name="com.jaspersoft.studio.table.style.detail" value="Table_TD"/>
    <property name="net.sf.jasperreports.export.headertoolbar.table.name" value=""/>
   </reportElement>
   <jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
    <datasetRun subDataset="Dataset2" uuid="916305ed-9825-46cc-a310-7ce0ff007eb9">
     <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{tableSource})]]></dataSourceExpression>
    </datasetRun>
    <jr:column width="90" uuid="68eb7039-c1b2-4db5-b27f-37ab3e32186b">
     <jr:columnHeader style="Table_CH" height="30">
      <staticText>
       <reportElement x="0" y="0" width="90" height="30" uuid="2bba3620-3898-4adf-972f-44fa13d9fc51"/>
       <text><![CDATA[HAWB No.]]></text>
      </staticText>
     </jr:columnHeader>
     <jr:detailCell style="Table_TD" height="30">
      <textField>
       <reportElement x="0" y="0" width="90" height="30" uuid="b7a12d21-3f46-47c6-85b7-8c23c44b714f"/>
       <textFieldExpression><![CDATA[$F{bl_no}]]></textFieldExpression>
      </textField>
     </jr:detailCell>
    </jr:column>
    <jr:column width="70" uuid="32a62a82-b923-4dd7-929c-096e6be16db0">
     <jr:columnHeader style="Table_CH" height="30">
      <staticText>
       <reportElement x="0" y="0" width="70" height="30" uuid="672fbfcc-309d-401f-a028-1f39a0e95a62"/>
       <text><![CDATA[No. of Pkgs]]></text>
      </staticText>
     </jr:columnHeader>
     <jr:detailCell style="Table_TD" height="30">
      <textField>
       <reportElement x="0" y="0" width="70" height="30" uuid="c0345b3e-e69a-4756-9323-0e3652ff8ce0"/>
       <textFieldExpression><![CDATA[$F{bl_qty}]]></textFieldExpression>
      </textField>
     </jr:detailCell>
    </jr:column>
    <jr:column width="60" uuid="03a91e26-1fc7-4487-b533-94a7c7a41fc7">
     <jr:columnHeader style="Table_CH" height="30">
      <staticText>
       <reportElement x="0" y="0" width="60" height="30" uuid="b2cda292-a77f-4453-aeaa-984b0b865115"/>
       <text><![CDATA[Weight/kg]]></text>
      </staticText>
     </jr:columnHeader>
     <jr:detailCell style="Table_TD" height="30">
      <textField>
       <reportElement x="0" y="0" width="60" height="30" uuid="e1563c3d-ae8e-4ce7-81bf-e7adc842993f"/>
       <textFieldExpression><![CDATA[$F{gwt}]]></textFieldExpression>
      </textField>
     </jr:detailCell>
    </jr:column>
    <jr:column width="170" uuid="06d620b8-c269-4c93-b1ce-484fcfbcb0d8">
     <jr:columnHeader style="Table_CH" height="30">
      <staticText>
       <reportElement x="0" y="0" width="170" height="30" uuid="cd62831b-35a7-4784-910e-ff7cbab588ce"/>
       <text><![CDATA[Nature of Goods]]></text>
      </staticText>
     </jr:columnHeader>
     <jr:detailCell style="Table_TD" height="30">
      <textField isStretchWithOverflow="true">
       <reportElement x="0" y="0" width="170" height="30" uuid="98b544a4-9f11-4fac-af39-e3fa659ec3ba"/>
       <textFieldExpression><![CDATA[$F{goods_desc}]]></textFieldExpression>
      </textField>
     </jr:detailCell>
    </jr:column>
    <jr:column width="220" uuid="70b59a04-5a7e-4b0e-9901-1d59fefbda38">
     <jr:columnHeader style="Table_CH" height="30">
      <staticText>
       <reportElement x="0" y="0" width="220" height="30" uuid="25a4f5a9-722d-4671-a442-a74666e41aa1"/>
       <text><![CDATA[Shipper Name & Address]]></text>
      </staticText>
     </jr:columnHeader>
     <jr:detailCell style="Table_TD" height="30">
      <textField isStretchWithOverflow="true">
       <reportElement x="0" y="0" width="220" height="30" uuid="1f9692dc-ccd4-402a-967b-18da55ff831c"/>
       <textFieldExpression><![CDATA[$F{shipper_alias}]]></textFieldExpression>
      </textField>
     </jr:detailCell>
    </jr:column>
    <jr:column width="230" uuid="06d5fd71-85a9-466f-955e-a0b359436570">
     <jr:columnHeader style="Table_CH" height="30">
      <staticText>
       <reportElement x="0" y="0" width="230" height="30" uuid="f7395265-6179-447e-8f06-f27fdb4f8489"/>
       <text><![CDATA[Consignee Name & Address]]></text>
      </staticText>
     </jr:columnHeader>
     <jr:detailCell style="Table_TD" height="30">
      <textField isStretchWithOverflow="true">
       <reportElement x="0" y="0" width="230" height="30" uuid="5c693a68-c058-4520-8fa0-dbb9a5651a0e"/>
       <textFieldExpression><![CDATA[$F{consignee_alias}]]></textFieldExpression>
      </textField>
     </jr:detailCell>
    </jr:column>
   </jr:table>
  </componentElement>
 </band>
</detail>

0 个答案:

没有答案