Is CheckBox checked or not in RDL reportview

2.6k views Asked by At

I've 2 checkboxs(actually two rectangles) in a report page. The object from the database, returns boolean value. If It returns yes, I want to checked "Yes" or not, the other one must be checked.

I'm newbie in RDL reporting project. How can I add an expression for this?

This is the image

2

There are 2 answers

0
Dan Scally On BEST ANSWER
  1. Right Click you Rectangle and go to Insert | Indicator
  2. When the Indicator window opens, Select the middle option in the "Symbols" Section (has a cross, exclamation and tick)
  3. Press OK, then Right Click the Indicator and click Indicator Properties
  4. Go to Value and States. In the list of States at the bottom, delete the X and the exclamation. Set the Tick to have Start = 1 and End = 1
  5. In the Value field enter =Iif(Fields!<<fieldname>>.Value = True, 1, 0) (obviously replace <> with the name of your field
  6. In the States Measurement Unit field, select "Numeric"

Here's a snap of how to do it:

Here's how to do it

What this will do is evaluate that Iif statement and, if your field is true, will return a 1. The indicator will see that 1 and place a Green tick in the Rectangle.

Hope that helps, drop a comment here if you struggle.

3
Werner van den Heever On

I assume you are using a Function or Stored Procedure Object from the database. Whatever the object returns, declare a variable, and assign the value from the object to the variable (is one way of doing it).

Then you can use:

if(variable == True)
{
   CheckBoxYes.Checked = true;
}