simonabertozzi Posted May 17, 2013 Share Posted May 17, 2013 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?Thanks,Simona Link to comment Share on other sites More sharing options...
Thomas Zimmer Posted May 19, 2013 Share Posted May 19, 2013 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, Thomashttp://www.thomaszimmer.net Link to comment Share on other sites More sharing options...
simonabertozzi Posted June 18, 2013 Author Share Posted June 18, 2013 It works! Thank you very much. Link to comment Share on other sites More sharing options...
john.v.little Posted September 22, 2014 Share Posted September 22, 2014 jasper server 5.6 doesnt have a resources folder in teh root/repository view Link to comment Share on other sites More sharing options...
chicolinux Posted May 26, 2016 Share Posted May 26, 2016 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 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