Jump to content
Changes to the Jaspersoft community edition download ×

Generating Subreports


doolan

Recommended Posts

Well, I've searched all over the forums and I can't find the solution to my problem.

 

I have a master report that uses a subreport. If I run the subreport by itself, I get a nice pdf report. However, when I try to include it in the master report, a get a blank page.

 

I think the jrxml files are ok, maybe my error is in the java code. Here's what I've got.

 

//Getting subreport

JasperCompileManager.compileReportToFile("reports/jrxml/SubreportDemo.jrxml");

 

JasperReport subreport = (JasperReport)JRLoader.loadObject("reports/jrxml/SubreportDemo.jasper");

 

//Preparing parameters

Map parameters = new HashMap();

parameters.put("SubreportDemo", subreport);

 

//Getting master-report

JasperCompileManager.compileReportToFile("reports/jrxml/MasterReportDemo.jrxml");

JasperRunManager.runReportToPdfFile("reports/jrxml/MasterReportDemo.jasper", parameters, connection);

 

Does the subreport need to be filled before it is passed to the master report as a parameter? Or does the master report do all the filling?

(I am using iReport to generate the jrxml files)

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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