How to create jrxml for sub reporting

前端 未结 2 1944
温柔的废话
温柔的废话 2021-01-24 08:07

I want create a complex jrxml file to create PDF.

I want to put another jrxml in my jrxml file.

So.. my question is how to put one

相关标签:
2条回答
  • 2021-01-24 08:42

    Or use the JasperCompileManager class from within the master jrxml file to dynamically compile it.

    <subreportExpression><![CDATA[JasperCompileManager.compileReport($P{SUBREPORT_DIR}+"/myFile.jrxml")]]></subreportExpression>
    
    0 讨论(0)
  • 2021-01-24 09:01

    Usually you develop reports with iReport.

    iReport has facilities for including subreports within reports (by dragging the subreport icon onto the master report page).

    Note that JasperReports uses absolute paths for file references. I would recommend you set up parameters to your reports as follows:

    $P{ROOT_DIR}
    $P{SUBREPORT_DIR}
    

    Give $P{SUBREPORT_DIR} a default value of $P{ROOT_DIR} + "subreports/".

    At that point, you can pass the absolute path as $P{ROOT_DIR} into your report and then the subreports will be stored in a subdirectory called subreports, which is located in $P{ROOT_DIR}.

    0 讨论(0)
提交回复
热议问题