1
votes

i'm trying to add subreport to report.

I have setted connection type to "use a connection expression" and the expression is $P{REPORT_CONNECTION}. My subreport contains a simple query and some static text, when i test it all works good, but when i test mainreport the subreport does not appear.

I have some static text in subreport, this one should be display always, isn't true? But i can't see it...

During compilation i have no errors, and subreport path seems correct becouse a message say "subreport.jrxml already compiled.".

What can i do?

Thanks.

3

3 Answers

2
votes

The solution is pass HIBERNATE_SESSION as parameter from master report to subreport.

1
votes

Please Right clik on sub report and clik on open sub report if your sub report gets open then your reporyt is connect with your sub report. if subreport is not open do the right connection for that. if your subreport is work for the parameter value with seperatly and displyes the static text and detail band values it is sure that the report will come ffrom main report. but the report displays only static text and the text is in title or page heder, then you have to go to the report property and set the output when no data then choose diplay all section data from combo. your static text will apper from main report.

0
votes

When you add a sub-report in your main report, the sub report expression will refer your locally saved sub-report path. Ex: "C:\abc\xyz.jrxml".

Now you can preview your main report containing sub-report in your ireport. Once you publish the main report in Jasper server, the Sub report gets loaded into jasper repository and its expression becomes "repo:Repositorypath.jrxml".

Once sub-report contained report is published into Jasper repository, its path will always refers to Jasper repository path and because of this reason, you will not be able to Preview the main report in Ireport.

So, execute the report in jasper server directly once you publish the main report instead of previewing or opening the subreport in Ireport.

Thanks, Srikanth Kattam