Jump to content
We've recently updated our Privacy Statement, available here ×

java.util.MissingResourceException in jasper with subdataset


rmjrao

Recommended Posts

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

  • 3 weeks later...
  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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

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:

  1. 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.
  2. create equivalent parameters in the table/List's data source's parameters section exactly as in step 1.
  3. 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...