highjo Posted June 25, 2012 Share Posted June 25, 2012 Hello,I'm developing an application in Java which generates reports using Jasperreports. My report has summary tables and a graph that uses a summarized form of the same data the main report uses. Rather than make multiple calls to the database for the same data, I fetch it once, process it and create three JRDataSources, one for the main and two for the tables/chart. Now, i want to pass the data sources for the tables as template parameters. Is this possible? If it is, could someone guide me as to how to do this? I need to set the data source passed as the source for the table.Here are some snippets of my xml file:Thanks.Code:...<subDataset name="Summary" uuid="7a0d9924-1304-410f-bfb5-2bccc7005adb"> ....fields...</subDataset> ...<parameter name="summary" class="java.lang.Object"/>...<jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd"> <datasetRun subDataset="Summary" uuid="7a0d9924-1304-410f-bfb5-2bccc7005adb"> <parametersMapExpression><![CDATA[$P{REPORT_PARAMETERS_MAP}]]></parametersMapExpression> <dataSourceExpression><![CDATA[$P{summary}]]></dataSourceExpression></datasetRun>...</jr:table> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now