I have a jasper (master) report embed in a jar. The report is got from a java input stream. The jasper report is made by iReport 3.7.0
In this master report, there are a few sub-reports. At the moment I have to use
Subreport Expression : $P{SUBREPORT_DIR} + "\\SubReport.jasper"
Expression Class : java.lang.String
in the iReport to make it works. It means that I store the subReport.jasper in SUBREPORT_DIR folder.
My question is, how to embed these sub-reports in the jar like the master report? And what should fill in the "Default Value Expression"? (if it is needed)
The closest question and answer so far I have seen is in here
How to load subreport resources with Jasper?
However the answer is not sufficient to me for master report compile. There is an error message saying missing sub-report when compile (and this is why I think the Default Value Expression may be needed?)
Thank you very much!
To add a new page go to Ireport and "Add Report Group" ,by adding report group you can add as many pages you want. Save this answer. Show activity on this post. Save this answer.
for example: i have report and subreport, located in some *.jar file. to invoke subreport i set subreport expression
getClass().getResource("/path/to/my/report/in/a/jar/subreport.jasper").openStream()
and choose subreport expression class java.io.InputStream
it is working!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With