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

Help me understand the benefit of subreports


jasonp_1

Recommended Posts

I have been racking my brain trying to understand how to use subreports.  I come from the Microsoft Reporting Services world so some of the concepts in JasperReports is a bit foreign to me.  One of the main reasons I would like to use subreports is to support reusability.  I could define a report segment once and then use it in multiple reports.  If I am just using iReport, the concept seems to work great.  However, if I plan on using the reports in the JasperServer, it seems to fall apart.  In order for a report in JasperServer to access a subreport, it must be embedded in the resources folder of the report as a .jrxml file.  This appears to then be a "copy" of the original report.  This means that if I need to make changes to my report segment, I need to copy the changes to every report that is using it.  It seems that one of the key uses of subreports is nullified when working in the server environment.  Am I missing something?

Please help this newbie out!

-Jason

 

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

    In the Jasper Server , for the subreports to be embedded into the one main report we need to add the subreport JRXML files as the resources , which is an option when we add a new jasper report in the repository . So for example,if there are two Reports which use a single subreport segment , so that particular subreport jrxml need to be inserted into the resources of the reports when they are added, rather adding it into a seperate resource folder. So this solves the problem of reusability if changes are done in that segment they automatically get updated in the reports wherever they are used ,so no extra efforts for copying the changes, or maintaining a seperate copy  of the segment for every report.

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