rbojja Posted July 10, 2008 Share Posted July 10, 2008 HIi created a master report and subreport on iReport toolIt 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 More sharing options...
Pethrus Posted July 10, 2008 Share Posted July 10, 2008 There should be no issue integrating this in Java. You just call your main report as you would call any report. Link to comment Share on other sites More sharing options...
szaboaz Posted July 10, 2008 Share Posted July 10, 2008 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 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