Author Topic: Jasper report - printing view's relations  (Read 587 times)

Joel01

  • Member
  • **
  • Posts: 10
Jasper report - printing view's relations
« on: November 12, 2020, 12:01:46 PM »
Hello,
I'm trying to customize the jasper report template, and I would like to print all the relations used in a view. Is there an easy way to get those relations?
Joël

Phil Beauvoir

  • Administrator
  • Hero Member
  • *****
  • Posts: 1639
  • Code Punk
    • Archi
Re: Jasper report - printing view's relations
« Reply #1 on: November 12, 2020, 12:55:46 PM »
I think it might be:

Code: [Select]
getChildElementsDataSourceForTypes("relations")
I replaced some lines in the view.jrxml file like this:

Code: [Select]
<dataSourceExpression><![CDATA[((com.archimatetool.jasperreports.data.ViewModelDataSource)$P{REPORT_DATA_SOURCE}).getChildElementsDataSourceForTypes("relations")]]></dataSourceExpression>
and that seemed to work.

General comment regarding the Jasper code - if you need to see how it works, you could take a look at it here:

https://github.com/archimatetool/archi/tree/master/com.archimatetool.jasperreports/src/com/archimatetool/jasperreports/data
« Last Edit: November 14, 2020, 15:05:12 PM by Phil Beauvoir »
If you value and use Archi please consider making a donation! https://www.archimatetool.com/donate