Jump to content
We've recently updated our Privacy Statement, available here ×

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


lisaws
Go to solution Solved by lisaws,

Recommended Posts

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.

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

  • Solution

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

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