JasperReports:如何将参数传递给subReport [英] JasperReports: How to pass parameter to subReport

查看:408
本文介绍了JasperReports:如何将参数传递给subReport的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将参数传递给中的子报告JasperReports

我能够将参数传递给主报告,但我无法将参数传递给其子报告。

I'm able to pass the parameter to master report but I'm not able pass parameter to its sub report.

任何人都可以给我解决方案吗?

Can any one give me the solution for it?

推荐答案

尝试使用 iReport 如果你不是。

在iReport中查看报告时,您可以在主报告中选择子报告的属性。

When viewing a report within iReport you can select the properties of the subreport within the main report.

在此子报告属性中有一个选项,名为参数。使用此方法,您可以将参数传递到子报告。

In this there is an option in Subreport properties called Parameters. Using this you can pass parameters to your subreport.


  • 选择此项并单击添加
    按钮。

然后点击
价值表达式右边的按钮 Box

接下来会弹出一个选项屏幕
,你可以从你想要的主报告中选择参数

通行证。

Next an option screen will pop up where you can select the parameter from the master report you want to pass.

如果你想通过xml这里做一个简单的例子。

If you want to do it via xml here's a quick example.

<subreport>
    <subreportParameter name="XML_ID">
        <subreportParameterExpression>
            <![CDATA[$P{MASTER_REPORT_PARAMETER}]]></subreportParameterExpression>
    </subreportParameter>
</subreport>

这篇关于JasperReports:如何将参数传递给subReport的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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