Show / Hide Fields in Pentaho Report Based on User Input

余生颓废 提交于 2020-01-06 01:29:06

问题


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.

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

Thanks for the help -Monica


回答1:


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())

Simple! :)




回答2:


There is more to this that the above answer. For example, if you don't want a field to show on the report, you pass the value mentioned above by Codek but the field will not show but the space for it will. The field has to be in a BAND and the band layout has to be set to ROW. Also, on the field you want to not display or display based on user selection, you have to set that field's style properties under size & position - invisible-consumes-space = false.



来源:https://stackoverflow.com/questions/19597884/show-hide-fields-in-pentaho-report-based-on-user-input

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!