Archi Forum

Discussion Boards => Archi Development => Topic started by: JanC on July 23, 2019, 08:57:09 AM

Title: Any thoughts on further customizing Jasper Reports?
Post by: JanC on July 23, 2019, 08:57:09 AM
For quite a while I am looking for means to customize the Jasper report layout - and luckily I often was able to accomplish what I wanted. Two subjects are currently of my concern …
a) the export to formats as ODT and DOCX … both show (at least with the version 4.3) some problems with the jasper <PageFooter> instruction as the footer is either placed immediately after the last 'Detail' band (ODT) or its length is not taken into account with the pagelength (DOCX). This problem though is likely bound to the Jasper exporter software itself and thus not of direct relevance for our discussions here. Though I would like to hear if others are facing similar issues.
b) for a long while I try to incorporate a table of contents to my reports, but have not found a working solution. Regoogeling (what a word ;-)) I stumbled across Jasper Report Books, promising a solution to this long known Jasper challenge. See for more details. Does anyone know if efforts have been done to integrate this approach into Archi?
Title: Re: Any thoughts on further customizing Jasper Reports?
Post by: Phil Beauvoir on July 23, 2019, 09:05:55 AM
I haven't done anything with Jasper in Archi for some time, except for updating the JR libraries in March. J-B contributed some good work on it with his Customisable report some time ago. Apart from that, no further developments or customisations.

Of course, this is open to contribution should anyone wish to take a look at it.

Title: Re: Any thoughts on further customizing Jasper Reports?
Post by: JanC on July 30, 2019, 16:17:21 PM
I have started to dig a little deeper into the subject getting a "Table of Contents" into Jasper reports and have managed to get through some initial hurdles.
Firstly - it only works using parts, which means that all the exiting templates need modification. Basically you need to replace the subreports in the main reports by parts referencing the subreport. That said, I noticed that each part automatically shows up on a new page. And if the printWhenExpression resolves to FALSE the subreport is not even evaluated. Thus … the parameter_report (quite a clever trick) not showing any data needs to be integrated on some other subreport where something is to be shown. The other thing with parts is, that you not only need to specify the datasource through the REPORT_DATA_SOURCE  parameter, it also requires this datasource not to be at the end. As the main report is been forwared until the end during the initial filling any subreport requiring the same ArchiMate model datasource will not print as there is no data anymore. I solved this by adding a clone() method to the file.
With respect to using parts … see for some more background information.
Though my work is not yet completed at all, I wanted to share some of my initial findings. And yes … very likely I will be able to get the Table of Contents realized!