Jump to content
Changes to the Jaspersoft community edition download ×

multiple subreports - deploy on Jasperserver


Recommended Posts

Hi all,

I've created a subreport that calls another subreport (creating a sort of three-level hierarchy). In iReport everything works fine.

Now I want to deploy these 3 reports on Jasperserver, but I'm facing a problem: if I deploy the master report, Jasperserver recognizes and uploads only the first subreport. What is the right way to do a deploy in this case?




Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic


Hi Simona,
deploy the subreports manually. two posibilities:
1) In the Repository Navigator, click on the subfolder "Resources" of your report and add your subreports as JRXML Documents
2) In the Web-UI of JAsperreports Server Edit the report, Select Controls & Resources from the left menue, then add your subreports as JRXML Documents (Resource)
BEWARE! In both cases you have to change the subreport expressions (in all reports using a subreport) Jasperreports Server uses expressions like "repo: reportname.jrxml" (in iReport you have a static path to your local file system). For the main report and the regular upload, iReport will change these expression, for your subreport and its sub-subreports you wil have to do this for yourself.
A good practice would be to store the subreport paths in a parameter ($P{SUBREPORT_DIR}), then pass the variable around to all subreports. so you will have it to change only in the main report. But additionally you will need another variable to set the file extension "jrxml"; in iReport you need the extension "jasper"...  My proposal: use parameter $P{SUBREPORT_DIR} with default value "repo:" and $P{SUBREPORT_EXT} with default value ".jrxml". Activate the "Use as prompt" option for the parameters. Your subreport expression(s) will be
$P{SUBREPORT_DIR} + "reportname" + $P{SUBREPORT_EXT}
If you execute your reports in iReport, you will be requested to give the file path and extension, on the server everything will be fine.
Other way would be to upload reports only once (with the manual corrections wrote above), then always execute the report remotely (right click in the repository navigator, "Run Report"; if you edit your report or subreport, open them from the repository navigator, then upload and run remotly again)
However, each possible solution for this has its own pitfalls (e.g. iReport will not compile the subreports automatically anymore, you will have to upload the subreports as resources manually...
Cheers, Thomas
Link to comment
Share on other sites

  • 5 weeks later...
  • 1 year later...
  • 1 year later...

I'm in the same situation, but with JasperStudio 6.1.1 and JasperServer 5.


So far, I have done what you advice:


$P{SUBREPORT_DIR} + "ClaroVideoR1_Det.jasper" + $P{SUBREPORT_EXT}


But I get many errors when I try to run the report on JasperServer.

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