rmjrao Posted February 5, 2013 Share Posted February 5, 2013 I was able to create a report with main dataset but not with sub dataset. I am getting java.util.MissingResourceException exception while genrating the report. Am i missing somthig while configuring the sub dataset?attached the sample jrxml file for reference. I appriciate any reply.Thanks,Rmjrao. Link to comment Share on other sites More sharing options...
luca.capitoli Posted February 27, 2013 Share Posted February 27, 2013 Hi, I have the same problem. specifically I have created a file jrxml (with iReport 4.7.0) that contains a table. Within a cell I declared a parameter (in the new dataset attached table). In a Java file I can create the report with the correct template. Now I should set the value of the parameter (contained in a subDataset) but can not find any method that allows me to set the value. How do I? Link to comment Share on other sites More sharing options...
luca.capitoli Posted February 27, 2013 Share Posted February 27, 2013 Ok I have the answer! as explained in this link http://hamroblog-sristi.blogspot.it/2011/04/passing-parameters-from-main-report-to.html To pass the parameters from main report to the table or list datasources in the iReport 3.6.7 or 4.0.1, we need to do following steps: create required parameters in the main report by right clicking on the parameters section of main report------> add parameter-------->set the properties (data type) of newly added parameter to your desired one. create equivalent parameters in the table/List's data source's parameters section exactly as in step 1. from report explorer, right click on the table and click on Edit Table DataSet ------> Select the parameters tab ----------->Click on add ---------->Choose the parameter (which you created in the dataset's parameter section in step 2.) from upper combo (i.e. Dataset parameter name) ------> then click on lower button (i.e.) assign value expression i.e. the params which you added in step 1.Now, you're done. The params(defined in scope of main report's parameter section) will be prompted to user at the report run-time and passed to the table's dataset's parameter which will be reflected in the table finally. NOTE: We can add the params as in step 2. above into the table's dataSets scope with their properties "use as a prompt" checked (for the sake them to be prompted at the runtime to user), but they won't be prompted and we'll have to stay frustrated ; DON't use this approach. Then you can set the value of the paramater in this way: report() .setTemplate(Templates.reportTemplate) .setTemplateDesign(DetailedReport.class.getResourceAsStream("4PunteggioComplessivo2.jrxml")) //map that set the value "posizione" = name of parameter, 13 = value ----------------> .addParameter("posizione", 13) <--------------- Link to comment Share on other sites More sharing options...
luca.capitoli Posted February 27, 2013 Share Posted February 27, 2013 ATTENTION!!!! the checkbox in option (of the param) called "use like a prompt" must be checked! 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