摘要带紧跟细节带

时间:2013-06-06 12:55:25

标签: jasper-reports ireport

我在这里遇到了一个情况。我一直试图解决这个问题几个星期。我是使用 iReport 的新手。

这些天我正在为公司部门设计一份报告。

我的报告只有3个频段,即标题明细摘要。这3个频段占用的空间大于一页。所以 iReport “帮了我一个忙”,它将细节频段和摘要频段,摘要分开了乐队被迫在新页面上开始,而细节乐队后面是一个大的空白区域。它看起来很不雅观。

现在我希望摘要频段紧跟明细频段,而不仅仅是在新页面上开始。

你能告诉我怎么做吗?谢谢你的帮助!

P.S。我已经更改了Page height属性,但它不能正常工作。我没有查看“新页面摘要”。 当详细信息频段只有几个来自数据源的结果时,摘要频段紧随其后。但是一旦从数据源获得了许多结果(比如15个结果),< strong>摘要乐队在新页面上开始。

感谢 Lisa 。我的JRXML简化如下。感谢我简化内容,因为我的摘要频段有点大。

<detail>
    <band height="20" splitType="Stretch">
        <textField isStretchWithOverflow="true" isBlankWhenNull="true">
            <reportElement positionType="Float" stretchType="RelativeToTallestObject" x="0" y="0" width="101" height="20" isPrintWhenDetailOverflows="true"/>
                <box>
                    <pen lineWidth="0.5"/>
                    <topPen lineWidth="0.5"/>
                    <leftPen lineWidth="0.5"/>
                    <bottomPen lineWidth="0.5"/>
                    <rightPen lineWidth="0.5"/>
                </box>
                <textElement textAlignment="Center">
                    <font fontName="楷体" size="12"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{productName}]]></textFieldExpression>
            </textField>
      <! several textFields followed … >
        </band>
</detail>
<summary>
    <band height="585" splitType="Prevent">
           <! many textFields and staticTexts followed … >
    </band>
</summary> 

1 个答案:

答案 0 :(得分:1)

是什么阻止您将细节带缩小到所需的最小尺寸?只需不留下任何不需要的空间,摘要将直接跟踪详细数据带中的数据......