How to refer to the value of a textbox in an expression window (Local Report)?
Asked Answered
T

1

9

The expression window doesn't need to be the expression window you can open by right-clicking the textbox -> choosing Expression. A textbox has some expression windows which are Font-related expression windows, Alignment-related expression windows, Visibility-related expression window,Border-related expression windows and the Value-related expression window.

In the Value-related expression window, I don't need to refer to the value of the current textbox, because it's exactly the value Expression used for the textbox. However I wonder if there is a way to refer to this value in other expression windows of a textbox? Or simply use the exact value expression of the textbox?

For example, the value expression of a textbox is =Fields!ID.Value, in another expression window (e.g the Color expression window), I want to refer to this value by some keyword if possible like this =IIF(this.Value > 0, "Green", "Red"). Currently I have to use the exact expression of the textbox and the expression for its color looks like this =IIF(Fields!ID.Value > 0, "Green", "Red").

I hope there is a simple way to refer the value of the current textbox, not through its exact expression, because sometimes the expression is too long to re-type it or even copying-n-pasting the expression is not better than a short keyword.

Thanks!

Tangelatangelo answered 3/5, 2013 at 15:16 Comment(0)
O
18
=IIF(ReportItems!ID.Value > 0, "Green", "Red")

Before that you have to Name your TextBox as ID

Oba answered 3/9, 2013 at 9:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.