Search code examples
jasper-reports

How to create group header in jasper report table using iReport?


Im trying to recreate a jrxml to be familiar in iReport. I already know how to create a simple table but this one's a bit complicated because of the grouping.

enter image description here

enter image description here

Could you tell me how to create another band called group header like the one shown in the screenshot? By the way i'm using iReport 5.6


Solution

  • Add the group in your tabelDataSet

    <subDataset name="tableDataSet" uuid="c72d8dbd-d63e-411b-862d-a0d6e1e25d37">
       ....
      <group name="group1">
         <groupExpression><![CDATA[$F{YourField}]]></groupExpression>
      </group>
    </subDataset>
    

    and you will find it magically in your table structure.

    EDIT: Added instructions for iReport:

    In iReport right click the groups in your tableDataset and select "Add group" (the screen shot is in Italian but "Aggiungi Gruppo" = "Add Group"

    iReport