Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

directly embedded subreport in JasperReports

I am so close to having this work, I am trying to directly embed one jasper subreport into the main report xml of the other. You'd think this would be easy, but I can't find a single example on doing it. Everyone seems to use files or resources or whatever. I have one report working straight from a string and I want it to contain it's subreport.

Anyone? Syntax? Thanks!

like image 733
Joshua Avatar asked Nov 06 '22 21:11

Joshua


1 Answers

The only way I know of to do this with JasperReports is to use a separate .jrxml file for the subreport, and include it in the main report using the subreport command.

Another option you have for any embedded reports is to use subdatasets, but as far as I know they're only useful for graphs.

As it sounds like you control the code surrounding the generation of the report, you could come up with a simple format to define multiple reports in the one string, and then have your code extract each report at runtime.

When we've needed to deal with a single file but have subreports for a JasperReport, we've used Zip files, and simply zipped up the main report and all it's necessary sub reports, and then unzipped them into a temporary directory when we need to (all in code of course)

like image 56
Jamie Love Avatar answered Nov 23 '22 04:11

Jamie Love