根据用户输入显示/隐藏 Pentaho 报告中的字段

根据用户输入显示/隐藏 Pentaho 报告中的字段

问题描述:

我正在尝试根据用户输入在 Pentaho 报告中显示/隐藏字段.

I'm trying to show / hide fields in a Pentaho report based upon user input.

例如,我想为用户提供一个复选框,说显示产品计数"——如果未选中该框,则报告中不会包含该列.

For example, I would like to offer a checkbox to the user saying "Show Product Count" -- if the box is unchecked, it will not include that column in the report.

有没有办法在 Pentaho Report Designer 中做到这一点,也许使用参数?

Is there a way to do this in Pentaho Report Designer, perhaps using Parameters?

感谢您的帮助-莫妮卡

是的,你有一半的答案.有一个是/否参数ShowProductCount"

Yes, you have half the answer. Have a Yes/No Parameter "ShowProductCount"

然后在条件字段上,转到可见属性,单击 + 公式图标并输入:

Then on the conditional fields, go to the visible property, click the + formula icon and enter:

=IF([ShowProductCount]="Yes"; TRUE(); FALSE())

=IF([ShowProductCount]="Yes"; TRUE(); FALSE())

简单!:)