Jasperreports - how to get JSON to fill in a subtitle

I am trying to get a table to populate with the same data in the main report using Jasper / iReport. How can I get Json to endure?

In the datasource data editor I tried:

((net.sf.jasperreports.engine.data.JsonDataSource)$P{REPORT_DATA_SOURCE})

new ((net.sf.jasperreports.engine.data.JsonDataSource)$P{REPORT_DATA_SOURCE})

$P{REPORT_DATA_SOURCE}

$P{REPORT_CONNECTION}

All of which compile, but none of them actually generate a table. Any ideas? There is no method like cloneDataSource () for JSON, so what's the alternative?

My ultimate goal is simple: pass JSON data and use it to create a chart, and then a table displaying the same information. I worked on this for many days, Jasper is hard for me. Please, help!

+5
source share
2 answers

. , JSON , subDataSource(), , , - , ...

: ((net.sf.jasperreports.engine.data.JsonDataSource)$P{REPORT_DATA_SOURCE}).subDataSource()

+7

- JasperReports ( 6+), JsonDataSource, json :

<p:subreportPart xmlns:p="http://jasperreports.sourceforge.net/jasperreports/parts" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/parts http://jasperreports.sourceforge.net/xsd/parts.xsd">
  <subreportParameter name="REPORT_DATA_SOURCE">
    <subreportParameterExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonDataSource)$P{REPORT_DATA_SOURCE}).subDataSource()]]></subreportParameterExpression>
  </subreportParameter>
  <subreportExpression><![CDATA["PROFILES_cover.jasper"]]></subreportExpression>
</p:subreportPart>

json, node subDataSource(java.lang.String selectExpression). :

.subDataSource("Northwind.Customers")

.subDataSource("Northwind.Customers(Country == USA)")
+1

All Articles