Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReportViewer how to display a boolean value differently

My data is stored in BIT field in SQL server (0 or 1) When I display it in reportviewer it shows TRUE or FALSE

I would like to change it to YES or NO Please advice.

like image 874
meda Avatar asked Jul 18 '13 00:07

meda


People also ask

How to display Boolean fields as Yes No instead of True False in ssrs?

According to Microsoft documentation you should be able to go to the properties of the column in the Report Model and set the Format attribute to either "truefalse" or "yesno" depending on how you want boolean values to display.

How do you show Boolean?

val1 = true; Now, use if statement to check and display the Boolean true value. if(val1) System. out.


1 Answers

You can change it in the report using iif.

=iif(Fields!YourBool.Value, "Yes", "No")

If your data is null then it will evaluate to "No". If you want it do be blank instead use this one

=iif(isnothing(Fields!YourBool.Value), "", iif(Fields!YourBool.Value, "Yes", "No"))
like image 193
kheld Avatar answered Nov 15 '22 07:11

kheld