Jump to content

Subreports in iReports


swetha reddy

Recommended Posts

hi,

 

I have created a subreport in a master report

when i am trying to access the main report iam getting exceptions like

 

net.sf.jasperreports.engine.JRException: Could not load object from location : .//AdjustmentClaimCompareReport_subreport1.jrxml

at net.sf.jasperreports.engine.util.JRLoader.loadObjectFromLocation(JRLoader.java:258)

Please help me out i am new to this ireports and its very urgent.

 

Thanks,

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

  • 11 months later...

I solved this by passing a hashmap parameter

parameters.put("SUBREPORT_DIR", "actual path to the subreport.jasper file location" );

should also end with a '', don't forget escape characters '' if you are hard-coding the path rather than use a file.getAbosolutePath() or something..

 

You have to mention in the subReport.jasper location correctly. First check by opening in i-report the subReport.jrxml report properties to see if the name matches with the correct name, for example, "childReport" given in the parentReport.jrxml's subReport location/expression as $P{SUBREPORT_DIR} + "childReport.jasper"

 

Make sure that the child is compiled to a ".jasper" before running your parent. Do a quick search if you cannot find it. If you don't know how to do that let me know!!!

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...