2014-01-12 2 views
-1

테이블 구성 요소에 계층 적 데이터를 표시하려면 그룹에 적용하고 싶습니다.테이블에 그룹 적용

이라는 Java 개체가 있습니다.

이 두 가지 속성이 있습니다

  • 이름 (문자열) 나는 그룹화 된 테이블을 구축하고자

  • lstInfo (SLAVE라는 이름의 다른 개체의 목록) 로 master.name 모두 표시하려면 lstInfo마스터 개체에 연결됩니다.

    나는 나의 DataSet 구성 요소 그룹 속성에 추가하려고 내 테이블은이 방법으로 정의하고있다 :

    • 먼저 열 이름
    • 두 번째 열 lstInfo

    하지만 내 보고서를 실행하고 다음 오류를 표시하십시오.

    Infinite loop creating new page due to column header overflow. 
    

    은 자세한 내용은 : 나는 내 관점을 변경했습니다 내 보고서 그릴

    편집

    <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> 
    
  • +0

    여기에 jrxml을 붙여 주실 수 있습니까? 오류를 디버그하는 것이 더 쉬울 것입니다. –

    답변

    0

    의 iReport IDE로 5.2.0을 사용하고 있습니다.

    대신 컬렉션과 함께 개체를 사용하여 데이터 매트릭스를 만들었습니다.

    이렇게하면 일련의 필드와 표가 올바르게 그룹화됩니다.