Archi Forum

Archi => General Archi Discussion => Topic started by: Miney on May 30, 2023, 12:06:03 PM

Title: Jasper Report Customisations
Post by: Miney on May 30, 2023, 12:06:03 PM
Hi there.

I have a question about the config for Jasper Reports.
Is it possible to add a parameter for the Jasper customisable report to the views that would hide printing the elements per diagram and only print the diagram?
A parameter such as Report:View:Hide:Elements.  I often want to print only the diagram and not all the elements on the diagram in the report because in some cases the diagram is sufficient for the intended audience.

If the effort would be substantial and this can't be accommodated based on need and committed priorities, is it possible to provide some hints on what would need to change to implement this?  I assume it requires changes in view.jrxml and elements.jrxml.

Thank you.
Title: Re: Jasper Report Customisations
Post by: Phil Beauvoir on May 30, 2023, 16:25:26 PM
Hi, and welcome to the Archi forums!

These are the options for Views:

Report:View:Detailed
Set to "true" to show a detailed list of elements.
Report:View:Hide
Set to "true" to hide the view.
Report:View:Hide:Diagram
Set to "true" to hide the diagram.

So, no, sorry there's no property for what you want to do.

You could edit the view.jrxml file and add another condition there. Unfortunately, it's a long time since I looked at the Jasper Reports templates so it would take me just as long to figure it out. @Jean-Baptiste Sarrodie do you have any pointers?

Regards,

Phil
Title: Re: Jasper Report Customisations
Post by: Jean-Baptiste Sarrodie on May 30, 2023, 19:43:02 PM
Hi,

Quote from: Phil Beauvoir on May 30, 2023, 16:25:26 PM@Jean-Baptiste Sarrodie (https://forum.archimatetool.com/index.php?action=profile;u=6) do you have any pointers?

I think I have better than that... If I remember well, I did this kind of modification some years ago for a colleague and I think I still have it. I'll look at it soon and will post it here (and maybe also start a PR for it to be mainstream).

Regards,

JB
Title: Re: Jasper Report Customisations
Post by: whemix on September 18, 2023, 11:45:00 AM
Hi @Jean-Baptiste Sarrodie ,

Just wondering have you happened to find the modification you talked about? 
Title: Re: Jasper Report Customisations
Post by: Jean-Baptiste Sarrodie on September 18, 2023, 15:13:28 PM
Hi,

Quote from: whemix on September 18, 2023, 11:45:00 AMJust wondering have you happened to find the modification you talked about? 

I've found the custom report I was refering to, but it does not rely on some parameter (or view property): it fully remove the list of elements in all cases.

Doing so can be achieved quickly by creating a copy of the default report template (you can find it in your Archi installation folder, then plugins/com.archimatetool.jasperreports_x.y.z/reports) and editing the view.jrxml file:

line 116, force hiding the "documentation" section by adding "false &&" to the test expression:
<printWhenExpression><![CDATA[false && $F{documentation} != null

line 133, force hiding the "view's properties" section by adding "false &&" to the test expression:
<printWhenExpression><![CDATA[false && $V{NON_REPORT_ENTRIES} != 0

line 174, force hiding the "elements" section by adding "false &&" to the test expression:
<printWhenExpression><![CDATA[false && !$V{VIEW_HIDE}.equals("true")

regards,

JB
Title: Re: Jasper Report Customisations
Post by: whemix on September 19, 2023, 10:43:58 AM
Thank you for the tip!