0
votes

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" which I'm hoping will point to that jrxml file on the repository.

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

1

1 Answers

0
votes

I figured out the problem. After reading http://community.jaspersoft.com/documentation/jasperreports-server-administration-guide/v550/jasperreport-structure which confirms 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}.