如何为子报告创建jrxml [英] How to create jrxml for sub reporting

查看:187
本文介绍了如何为子报告创建jrxml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个复杂的 jrxml 文件来创建PDF。

I want create a complex jrxml file to create PDF.

我想把另一个 jrxml 放入我的 jrxml 文件。

I want to put another jrxml in my jrxml file.

所以..我的问题是如何将一个 jrxml 放到另一个 jrxml

So.. my question is how to put one jrxml to another jrxml

我的 jrxml 文件是: salesreport.jrxml financialreport.jrxml report.jrxml

我想把 salesreport.jrxml financialreport.jrxml report.jrxml

推荐答案

通常用 iReport

iReport具有在报告中包含子报告的功能(通过拖动主报告页面上的子报告图标。)

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

请注意,JasperReports使用绝对路径进行文件引用。我建议您按如下方式为报告设置参数:

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}

$ P {SUBREPORT_DIR} a默认值 $ P {ROOT_DIR} +subreports /

此时,您可以通过将绝对路径作为 $ P {ROOT_DIR} 添加到您的报表中,然后子报表将存储在名为子报表<的子目录中/ code>,位于 $ P {ROOT_DIR}

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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆