Search code examples
javajasper-reportsdynamic-reports

Dynamic Reports : Custom Group Footer based on Group Name


I am using Dynamic Reports, for generating reports. I need to know if I can use the Group Name and create a footer to the group. The footer is not subtotal, but something like a warning and description. The Groups I have are Alarm names like 'Warning Light is turned on' followed by details about the places it is turned on. The footer has to indicate the solution like 'Turn the heater off'. Below are the solutions I tried:

  • If I use a Group footer with an Expression (switch case of Alarm Names and hardcoded strings), the expected warning message gets attached to the previous Group. How to write an expression to get the current Group name?
  • If I use DynamicReports.sbt, it is shown only under one column. How to span it across multiple columns?

I am new to Dynamic Reports, any help is appreciated. Thanks.


Solution

  • Solved.

    • Add a new detail to the Datasource, which has the Solution strings like ' like 'Turn the heater off' corresponding to each Alarm name. Initial Datasource: ('Alarm_Name','Place_Name'). Current Datasource: ('Alarm_Name', 'Place_Name','Solution').
    • Add a new Field called 'Solution' pointing to the solution in the datasource.
    • Create a text component with the field 'Solution'.
    • Add the component to the group footer.