JasperReports / iReport Designer:我可以有条件地演奏乐队吗? [英] JasperReports / iReport Designer: Can i show a band conditionally?

查看:93
本文介绍了JasperReports / iReport Designer:我可以有条件地演奏乐队吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个报告如下:

I have created a report as follow:

多个细节带
每个细节带包含1个表。每个表都链接到1个数据集。

Multiple detail band each detail band contains 1 table. Each table is linked to 1 dataset.

只要查询的结果集返回Empty set(找不到结果),我可以隐藏详细信息带吗?

Can I hide the detail band whenever the result set of the query returns Empty set (no result found)?

我该如何实现?

推荐答案

在每个细节乐队的属性中你有一个名为Print When Expression的选项,你可以把逻辑评估为 boolean

In the "Properties" of each Detail band you have an option called "Print When Expression" there you can place logic that evaluates to boolean.

当你用你的逻辑填充它,它返回 true 打印这个细节带。

When you fill it with your logic and it returns true this detail band is printed.

所以,你需要有如果表格将提前填写并且无法处理其中的数据集,则会显示该信息。

So, you will need to have the information if the table will be filled in advance and cannot address the dataset within.

如果您的数据集太不同而无法执行此操作,则应覆盖主数据集使用自定义报告来收集信息并正确设置字段。

If your datasets are too different to do this, you should overwrite the Dataset for the main report with a custom one that gathers the information and sets the fields appropriately.

这篇关于JasperReports / iReport Designer:我可以有条件地演奏乐队吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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