rida_10 Posted December 15, 2011 Share Posted December 15, 2011 HI ALL,,, ihave been working on ireport designer 3.0, to develop sub reportsand i used the $R{subreports.folder} resource bundle to refer to the location for my sub report as such: $R{subreports.folder} + java.io.File.separator + "Sub_TotalSummary.jasper" where subreports.folder property refers to a location on the hard disk :subreports.folder=D:/my-reports/build/3.0.0 (all .jasper reports are generated in this directory)so where ever we want to run the report we only change the value of subreports.folder THE QUESTION IS HOW TO REFER TO SUB REPORTS WHEN REPORTS ARE RUN FROM JASPER SERVER NOT FROM AN ORDINARY JAVA APPLICATION. THANK YOURIDA Link to comment Share on other sites More sharing options...
pioppogatto Posted December 15, 2011 Share Posted December 15, 2011 Hi, I usually save the subreport in the same directory of master report and I'm using$ P{SUBREPORT_DIRECTORY} + “subreport_name.jasper†as subreport exression.When I create the report unit on JasperServer I put the subreport under "Resources" of the report unit. Hope to be usefull ...A. Link to comment Share on other sites More sharing options...
nitinsahu Posted December 15, 2011 Share Posted December 15, 2011 Hi Rida, You need to change the subreports.folder value as "repo:" and upload your subreport as a resource to the same report. This will solve your issue. For example: your subreport location should be "repo:Sub_TotalSummary.jasper". Regards,Nitin Sahu Link to comment Share on other sites More sharing options...
rida_10 Posted December 15, 2011 Author Share Posted December 15, 2011 thanks piopogatto, but did u add the sub report first to jasper server as a report unit by it self ???nice day Link to comment Share on other sites More sharing options...
rida_10 Posted December 16, 2011 Author Share Posted December 16, 2011 thanks piopogatto , it Worked! Link to comment Share on other sites More sharing options...
rida_10 Posted December 16, 2011 Author Share Posted December 16, 2011 Hi Nitinyour proposed way resulted in an exception:Error loading object from URL : repo:/Reports/Services/IPT/Sub_TotalSummary.jasperas i run the report, pioppogatto's way worked, Best regards Link to comment Share on other sites More sharing options...
pioppogatto Posted December 16, 2011 Share Posted December 16, 2011 Hi Rida,I sow you solved your problem with my solution! I'm writing "my solution" for everybody else that see this thread ....1) In iReport you can develop your master report with one ore more subreports. It's important to save the path of the directory of the subreport not as an absolute path (like C:\\my_jasper\\subreport.jasper) but using a parameter (if you use the wizard when you are designing you subreport in your master one, you have to check the right option, and the subreport path will be (Attachment 1):$P{SUBREPORT_DIR} + "name_of_subreport.jasper" 2) When you will add the Report Unit on your JasperServer you will be asked the proposed expression for you subreport (Attachment 2). Click on "Continue" button to confirm the expression "repo:name_of_subreport.jrxml"With such procedure JaspeServer will automacitally copy your subreport under the Resources directory of your report unit (Attachment 3)Hope this should be usefull for everyboy.ByePioppogatto 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