Java 在表上应用组

Java 在表上应用组,java,jasper-reports,grouping,javabeans,xmltable,Java,Jasper Reports,Grouping,Javabeans,Xmltable,我想在我的表组件上应用一个组来显示分层数据 我有一个名为MASTER的Java对象 这有两个属性: 名称(字符串) lstInfo(另一个名为SLAVE的对象的列表) 我想构建一个按master.name分组的表,以显示链接到master对象的所有lstInfo 我尝试在我的数据集组件上添加一个组属性,我的表是这样定义的: 第一列名称 第二列lstInfo 但当我启动报告时,显示以下错误: Infinite loop creating new page due to column hea

我想在我的表组件上应用一个组来显示分层数据

我有一个名为MASTER的Java对象

这有两个属性:

  • 名称(字符串)
  • lstInfo(另一个名为SLAVE的对象的列表)
我想构建一个按master.name分组的表,以显示链接到master对象的所有lstInfo

我尝试在我的数据集组件上添加一个组属性,我的表是这样定义的:

  • 第一列名称
  • 第二列lstInfo
但当我启动报告时,显示以下错误:

Infinite loop creating new page due to column header overflow.
更多信息:我使用iReport 5.2.0作为IDE来绘制报告

编辑

<jr:column width="90" uuid="e562503c-d39f-47e3-b50a-04669ebe1d33">
    <jr:tableHeader style="table 1_TH" height="30"/>
    <jr:tableFooter style="table 1_TH" height="30"/>
    <jr:groupHeader groupName="grpMaster">
        <jr:cell style="table 1_TH" height="30">
            <textField>
                <reportElement uuid="e7e52c98-1631-4237-a11b-6167acbf4e01" x="0" y="0" width="90" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[""+$F{master.name}]]></textFieldExpression>
            </textField>
        </jr:cell>
    </jr:groupHeader>
    <jr:groupFooter groupName="grpMaster">
        <jr:cell style="table 1_TH" height="30"/>
    </jr:groupFooter>
    <jr:columnHeader style="table 1_CH" height="30">
        <staticText>
            <reportElement uuid="85a422bc-2d60-4cd2-8058-ffbc8f18b69c" x="0" y="0" width="90" height="30"/>
            <textElement/>
            <text><![CDATA[master.name]]></text>
        </staticText>
    </jr:columnHeader>
    <jr:columnFooter style="table 1_CH" height="30"/>
    <jr:detailCell style="table 1_TD" height="20"/>
</jr:column>
<jr:column width="90" uuid="e47bd6ce-098d-447c-ae54-0639110ce45e">
    <jr:tableHeader style="table 1_TH" height="30"/>
    <jr:tableFooter style="table 1_TH" height="30"/>
    <jr:groupHeader groupName="grpMaster">
        <jr:cell style="table 1_TH" height="30"/>
    </jr:groupHeader>
    <jr:groupFooter groupName="grpMaster">
        <jr:cell style="table 1_TH" height="30"/>
    </jr:groupFooter>
    <jr:columnHeader style="table 1_CH" height="30">
        <staticText>
            <reportElement uuid="de0366d9-3e7e-42ce-a755-279bcbbf4b81" x="0" y="0" width="90" height="30"/>
            <textElement/>
            <text><![CDATA[lstInfo]]></text>
        </staticText>
    </jr:columnHeader>
    <jr:columnFooter style="table 1_CH" height="30"/>
    <jr:detailCell style="table 1_TD" height="20">
        <textField>
            <reportElement uuid="2a8a5b05-49df-4f92-8cb0-65a2166ebf87" x="0" y="0" width="90" height="20"/>
            <textElement/>
            <textFieldExpression><![CDATA[""+$F{lstInfo}]]></textFieldExpression>
        </textField>
    </jr:detailCell>
</jr:column>

我改变了我的观点

我创建了一个数据矩阵,而不是将对象与集合一起使用


通过这种方式,我可以从一组字段中进行分组,并且表可以正确显示。

您可以将jrxml粘贴到这里吗?调试错误会更容易。