How to prevent repetition of data display in report?

后端 未结 3 497
忘了有多久
忘了有多久 2021-01-21 21:10

Sample Report - Design

\"My

Sample Report - Preview

相关标签:
3条回答
  • 2021-01-21 21:37

    You have put your table component into the detail band. The detail band is repeated for every record in the dataset. You have two records, so your table is repeated twice; If you had more data, you would get many more repetitions.

    You could get rid of the table component completely, putting each columnHeader element from the table into a <columnHeader> band, and each detailCell element into a <detail> band. Doing this should preserve the behaviour of the table component without repeating it. See http://community.jaspersoft.com/wiki/designing-report for an example of this.

    Alternatively, you could simply move your table component into a different band that doesn't get repeated (e.g. <summary>).

    0 讨论(0)
  • 2021-01-21 21:40

    If your table shows multiple times within List component, uncheck "Print when Detail Overflow" and try. It works for me.

    0 讨论(0)
  • 2021-01-21 22:02

    Copy the table component in summary band and delete the detail band.

    If you want repeated value in table data then edit your table component in Ireport and select the text field and uncheck the "Print Repeated Values" check box property of a text field.

    XML CODE will be like this:-

              </jr:columnHeader>
              <jr:detailCell style="table 1_TD" height="20" rowSpan="1">
                 <textField>
                    <reportElement uuid="560916c9-e02a-40c9-a7af-a63d285b900a" 
              isPrintRepeatedValues="false" x="0" y="0" width="131" height="20"/>
                 <textElement textAlignment="Center" verticalAlignment="Middle">
                     <font size="12"/>
                </textElement>
               <textFieldExpression><![CDATA[$F{schooldetails_Phone}]]>  
               </textFieldExpression>
                 </textField>
                </jr:detailCell>
              </jr:column>
    
    0 讨论(0)
提交回复
热议问题