Jasper Report Customisations

Started by Miney, May 30, 2023, 12:06:03 PM

Previous topic - Next topic

Miney

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.

Phil Beauvoir

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
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Jean-Baptiste Sarrodie

Hi,

Quote from: Phil Beauvoir on May 30, 2023, 16:25:26 PM@Jean-Baptiste Sarrodie 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
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

whemix

Hi @Jean-Baptiste Sarrodie ,

Just wondering have you happened to find the modification you talked about? 

Jean-Baptiste Sarrodie

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
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

whemix