Locally I have a master.jrxml
report and some subreport.jrxml
and can load and manipulate the subreport via ReportDesign design = JRXmlLoader.load( "/local-file-dir/path/to/subreport.jrxml" )
in the Scriptlet code.
On the server, the above load method (trigged by my master.jrxml
) obviously cannot deal with repo paths, no matter what I tried (basically net.sf.jasperreports.engine.JRException: java.io.FileNotFoundException: ...
)
(subreport.jrxml
uploaded as a JRXML File Resource - not as Report with invisibly created folder structures ;
subreport-attached.jrxml
uploaded as a file resource of my master.jrxml Report
)
- apwop) absolute repo path without protocol prefix, e.g.
/repo/path/subreport.jrxml
- apwp) absolute repo path with protocol prefix, e.g.
repo:/repo/path/subreport.jrxml
- rpwop) relative repo path without protocol prefix, e.g.
subreport-attached.jrxml
- rpwp) relative repo path with protocol prefix, e.g.
repo:subreport-attached.jrxml
I also tried the following with the above uri variants as found elsewhere in the web without success:
JRXmlLoader:
JRXmlLoader.load( new DefaultRepositoryService( DefaultJasperReportsContext.getInstance() ).getInputStream( subrepPath )
RepositoryUtil:
RepositoryUtil.getInstance( DefaultJasperReportsContext.getInstance() ).getInputStreamFromLocation( subrepPath )
- JasperServerUtil: similar to this I am still trying out and will report back (had problems with proper Maven jasperserver libraries support till now - other problem I may address in another question)
- update: it worked: see my answer below