Sunday, February 23, 2014

020. iReport: GROUPING


We have to read and understand CREATE NEW REPORT
This tutorial using iReport 4.1.1.


  1. Open report previously had created (example: rptDDA)
  2. Click Query Button
  3. Write this sql:
    SELECT P.IDPARENT, P.DVARCHAR PVAR, C.*
    FROM SCH.CHILD C

        INNER JOIN SCH.PARENT P USING (IDPARENT)

  4. Click Read Fields button.
  5. Click OK
  6. All of Fields will be shown in Report Inspector tab -> Fields node.
  7. In Inspector Report tab, rightclick the upper node, then select Add Report Group
  8. In Dialog, set Group Name = grpIDParent, Group by the following report object = IDParent
  9. Click next button, then Finish.


  10. Now, we will see two group band, group header and group footer.


  11. In Inspector Report tab, Fields node, select IDPARENT and PVAR, then drag them to group header band.
  12. Fit the band height, by double click the bottom line of group header band.

  13. Click Preview button.