我想创建一个复杂的jrxml文件来创建 PDF。
我想在我的jrxml文件中放置另一个jrxml 。
所以..我的问题是如何将一个jrxml放到另一个jrxml
我的jrxml文件是:salesreport.jrxml、financialreport.jrxml和report.jrxml
我想将salesreport.jrxml和Financialreport.jrxml放到report.jrxml中。
我想创建一个复杂的jrxml文件来创建 PDF。
我想在我的jrxml文件中放置另一个jrxml 。
所以..我的问题是如何将一个jrxml放到另一个jrxml
我的jrxml文件是:salesreport.jrxml、financialreport.jrxml和report.jrxml
我想将salesreport.jrxml和Financialreport.jrxml放到report.jrxml中。
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}
.
或者使用主 jrxml 文件中的 JasperCompileManager 类来动态编译它。
<subreportExpression><![CDATA[JasperCompileManager.compileReport($P{SUBREPORT_DIR}+"/myFile.jrxml")]]></subreportExpression>