micmayers_i Posted May 23, 2011 Share Posted May 23, 2011 HelloI´ve found following code for using subDataset in Charts.This Code is working without the parameter.My Question now is, how to pass the parameter to the JRXmlDataSource.Thanks very muchmic Code:<lineChart><chart>...</chart><categoryDataset><dataset> <datasetRun subDataset="Parameter"> <datasetParameter name="param"> <datasetParameterExpression></datasetParameterExpression> </datasetParameter> <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRXmlDataSource(new java.io.File("C:\\test.xml"), "/test[@id='$P{param}']/tested")]]> </dataSourceExpression> </datasetRun></dataset> Link to comment Share on other sites More sharing options...
jpauze Posted May 24, 2011 Share Posted May 24, 2011 Should be able to righ click the sub-dataset in the report inspector and bring up the properties, within there if I recall is a parameter mapping section which allows you to map parameters in the sub-dataset from the calling report. Link to comment Share on other sites More sharing options...
mulcamd Posted May 24, 2011 Share Posted May 24, 2011 Select the chart -> right click option "Chart data" -> Tab parameters (under drop down box "Sub dataset" Link to comment Share on other sites More sharing options...
micmayers_i Posted May 25, 2011 Author Share Posted May 25, 2011 Hydosen´t works with the part "[@id=$P{param}]"doesen´t matter which settings I tried in the parameter Tab (under drop down box "Sub dataset"). Mayby you can tell me a bit more explicite how to set the parameter for the dataSourceExpression.Thanks micPost Edited by micmayers_i at 05/25/2011 10:44Post Edited by micmayers_i at 05/25/2011 10:45 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