jasper-reports Using subreports


parametersMapExpressionThe Map with parameters. Not required
subreportParameterThe pair of name and value (set with subreportParameterExpression). Not required. Several parameters can be passed to subreport
connectionExpressionConnection for getting data. Not required
dataSourceExpressionExpression for passing Datasource. Not required
subreportExpressionThe subreport's path/URI or even JasperReport object. Not required
returnValueThe pair of name and value. Not required. Several values can be returned from subreport to master report back


  • Subreports can be used for constructing complex reports. The reusing of existing reports is another goal of using subreports.

  • The subreport will be shown as a part of master report in case using of <subreport> element.

  • The value of subreportExpression parameter is differ for using at JasperReports Server or just by JasperReports framework (some API using or using in IDE).

    For JasperReports Server it looks like:


    For using by just JasperReports engine:


    The great explanation by @AndreasDietrich can be found at JasperServer: Unable to locate the subreport exception post

  • For some reasons the subreport can be used as a common report - without calling from the master report (with help of <subreport> element). The subreport is always a report.