Jason
Jason

Reputation: 821

SQL Server ReportBuilder expressions

I have the following code:

 if (qRadioSystemChoice1.Checked) 
    qRadioSystemChoice = "1";
 else if (qRadioSystemChoice2.Checked) 
    qRadioSystemChoice = "2";
 else if (qRadioSystemChoice3.Checked) 
    qRadioSystemChoice = "3";

 updateDataInfo.AddParm("qRadioSystemChoice", qRadioSystemChoice, "int");

In SQL Srver ReportBuilder 2.0 is it possible to have 3 fields and then place an X next to that line of text if it was checked?

Example:

X (1 text here
_ (2 text here
_ (3 text here

I am looking at the expression builder and I see I have =Fields!qRadioSystemCoice.Value so does this mean I could have it place an X if the value is 1~3?

Upvotes: 0

Views: 72

Answers (1)

Dan Scally
Dan Scally

Reputation: 2042

Yes, basically. You just add an IF statement in Report Builder next to each line:

=Iif(Fields!qRadioSystemChoice.Value = "1", "X", Nothing)

Then repeat that for lines 2 and 3, obviously replacing "1" in the code with "2" and "3" as appropriate.

Upvotes: 1

Related Questions