This is a migrated thread and some comments may be shown as answers.

Display Text at certian value

1 Answer 91 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Brett
Top achievements
Rank 1
Brett asked on 17 Jun 2008, 12:09 AM

I have a report that has a textbox and gets it's values from a MS-SQL database, when the textbox has a value of 0 I would like the text box to  display text.

For example,

If fields.Cost is equal to 0 then display "No Cost"

Or sometimes, if the value is 0 I would like it to display nothing at all.

How would I go about doing that?

Thanks,

Brett

1 Answer, 1 is accepted

Sort by
0
Accepted
Steve
Telerik team
answered on 17 Jun 2008, 02:06 PM
Hello Brett,

If you do not want to see that 0 value on you report's surface, in the TextBox item that renders it, use the following expression:

=IIf(Fields.Cost = 0, "No Cost", Fields.Cost)

If in some scenarios under certain condition you would like to show empty you would need to replace No Cost with "". This is much easier to handle using the
textBox_ItemDataBound eventhandler using the processing item.

All the best,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Brett
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or