Setting subreport path to another jrxml located elsewhere on the Jasper repository

Hi,

I'm trying to create a report that includes a subreport that is located elsewhere in the Jasper repository (and not under the main report's Resources folder).  The file I want to use for the subreport is a jrxml resource located at /public/DEV/test/test_subreport.jrxml.  In the main report, which is located at /public/DEV/test, I have a subreport element.  I have set the subreport expression to "repo:/public/DEV/test/test_subreport.jrxml".  When I try to run the main report, I get no errors and only a blank page.  I'm pretty sure that the main report is able to find the test_subreport.jrxml file because when I change the subreport expression to something else (for ex. adding an extra character to the path), it errors as expected "Error opening input stream from URL: repo:/public/DEV/test/test_subreportX.jrxml".

Both the main report and subreport have appropriate dummy queries in them so that is not the issue. 

Any help would be appreciated!  I'm using iReport 5.2.

lisaws's picture
261
Joined: Oct 16 2015 - 10:14am
Last seen: 4 years 2 weeks ago

1 Answer:

I figured out the problem.  After reading http://community.jaspersoft.com/documentation/jasperreports-server-admin... and knowing that what I am trying to do is definitely possible, I looked closer into my main report, and saw that for the subreport element I needed to pass a data connection along to the subreport.  I set Connection Type to "Use a connection expression" and se tthe connection expression to $P{REPORT_CONNECTION}.

lisaws's picture
261
Joined: Oct 16 2015 - 10:14am
Last seen: 4 years 2 weeks ago
Feedback