开发者

How to show a value in a textfield in Ireport?

开发者 https://www.devze.com 2023-03-31 18:19 出处:网络
I\'m currently creating a reports related to business organizations. The report I need to make is one that shows a text whenever a certain value is equal to zero.

I'm currently creating a reports related to business organizations. The report I need to make is one that shows a text whenever a certain value is equal to zero.

e.g.

I have php file that passes parameters to my ireport to create the report. In the php file there is a dropdown box which selects the departments(all values except the selection ALL DEPARTMENTS are from the database, the all departments throws back a value of zero.)

I was wondering as to how the value ALL DEPARTMENTS would show in the textfield in my ireport if the throwned value is equal to zero.

I开发者_如何学Go have already tried using case statements in my where but to no avail. Thanks and I do hope you could help me on this one.


You can try to use text field expression, for example:

<textFieldExpression><![CDATA[$P{departmentFilter}.equalsIgnoreCase("ALL DEPARTMENTS") ? "All departments in company" : $P{departmentFilter}]]></textFieldExpression>
0

精彩评论

暂无评论...
验证码 换一张
取 消