Jump to content
Changes to the Jaspersoft community edition download ×

subreport took the source of the main report


deadsploid

Recommended Posts

Hello, is it possible to make the sub-report take the data source from the main report, if so, how?
I load a report on jasperserver and it turns out that it should work on 14 databases and I would like to have a data source only for the main report than to do 28 actions of the same type

I also sent the subreport file to the jasperserver, but it does not see it, although it is on the server. when adding a subreport, the folder shows that it is empty

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Thank you for posting to the Jaspersoft Community. Our team of experts has read your question and we are working to get you an answer as quickly as we can. If you have a Jaspersoft Professional Subscription plan, please visit https://support.tibco.com/s/ for direct access to our technical support teams offering guaranteed response times.
 

Link to comment
Share on other sites

If you use the standard approach of 

<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>

in your subreport reference configuration, that $P{REPORT_CONNECTION} is the datasource of the parent report. So what you're asking about is the default behavior. By default, if you pass that $P{REPORT_CONNECTION} as the connection expression, it will use whatever the parent report is using. In terms of supporting 14 databases dynamically, there are definitely ways this can be done, but they're fairly advanced configurations.

 

If you're not seeing the subreport being populated on JasperServer, JasperStudio may not be able to find it when you initially publish the parent report. If you're publsihing these via studio, during the 'create server report' wizard, you'll see any/all of the resources being promoted as part of the report unit. If these aren't getting published at that point, it's typically due to the subreport 'path to file'. You can always add subreports directly on jasper server via the 'edit report' options, but you may also need to update the 'path to file' to reflect 'repo:subreportName.jrxml' and so on. 

Link to comment
Share on other sites

Thank you very much for your answer.
I'm sorry I didn't phrase it that way. The problem is that when I want to use a subport that is located on the jasperserver, then during the selection it does not see it in the directory. It appears and disappears for less than a second.
I will attach a screenshot of how everything looks in studio and server.

As you can see in the screenshot, there is a file on the server, but the studio does not see it. I tried to manually enter the path "repo:/recTemp/SubreportHeader.jrxml", but it says that the source was not found.
net.sf.jasperreports.engine.JRException: Resource not found at: repo:/recTemp/SubreportHeader.jrxml.

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