Expand/collapse detail rows in viewer (DrillDown)

0

hi

We would like to realize a DrillDown functionality in JasperReports. The origin of our JasperReports is CrystalReports.

If the user clicks on a group heading in the viewer, the detail data records should be displayed or hidden. This is what our current solution looks like:

We use an already compiled report. We catch the group heading click with a hyperlink listener. Then a parameter for the display (type: ArrayList) is changed accordingly and the compiled report is completely recreated with an in-memory datasource. The JRViewer panel will be replaced by an updated panel. After that the previously displayed page will be displayed.

Who knows a better solution? Is it possible to optimize the complete rebuilding of the report? Is there a shortcut?

Usually our reports need a relational database. What's the best strategy to get an in-memory datasource? In our first attempt we developed a List/List/Map for the datasources/rows/fields. But it may be possible to get this with a SortField.

Regards
Marcus

Java 8 / Swing / JasperReports 6.0.4 jar
 

Marcus W's picture
Joined: Nov 7 2017 - 7:32am
Last seen: 11 months 2 weeks ago

1 Answer:

0

For the datasource, I usually use a in-memory database such as hsql.

Most times nowadays, I don't use Swing but use html instead.

hozawa's picture
51278
Joined: Apr 24 2010 - 4:31pm
Last seen: 4 months 2 weeks ago
Feedback
randomness