Jump to content
JasperReports Library 7.0 is now available ×

subreport in java


rbojja

Recommended Posts

HI

i created a master report and subreport on iReport tool

It is working fine on iReport.

 

Now i need to integrated this master and subreport on my webapplication.

 

How to call a subreport here.I am stuck here.

 

Any sample code will help me .

 

Thanks

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Set "Subreport Expression" to the subreport's filename (with .jasper extension). E.g. "mysubreport.jasper" (between "" signs), and choose java.lang.String as Subreport Expression Class.

 

Now you need to put your subreport jasper file to the classpath of your web application (e.g. into WEB-INF/classes), and nothing else needs to be done, when you generate the master report, it will be found.

 

Another practical approach is that you set Subreport Expression Class to e.g. net.sf.jasperreports.engine.JasperReport, and its value is a parameter (of the same type). This parameter gets its value just like the other parameters: so you can instantiate your subreport in your java code (just like you do with your master report) as a net.sf.jasperreports.engine.JasperReport object, and add it to the parameters.

 

HTH,

Arpad

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