all groups > sql server reporting services > september 2007 >
You're in the

sql server reporting services

group:

Boolean formatting in report



Boolean formatting in report midas
9/20/2007 12:03:35 PM
sql server reporting services: I have a data source with a column that is a boolean data type. When
I render this data on the report the value of 0 displays as "False"
and 1 displays as "True". I would like 0 to display as "No" and 1 to
display as "Yes". I am assuming I have to set up an IIF statement
that evaluates the value and changes the display based on that. I was
wondering if anyone knew of a better way, such as a Custom Format
value that would be a better route?

Thanks in advance for any assistance!
Re: Boolean formatting in report EMartinez
9/21/2007 1:36:34 AM
[quoted text, click to view]


The way you mentioned is quick and the effort is negligible.
=iif(Fields!SomeField.Value = True, "Yes", "No") -or- =iif(Fields!
SomeField.Value = 1, "Yes", "No")
You could also try using a case statement in the query/stored
procedure that is sourcing the report.
select case when SomeField = 'True' then 'Yes' else 'No' end as
SomeField, ... from table_x ...
Hope this helps.

Regards,

Enrique Martinez
Sr. Software Consultant
Re: Boolean formatting in report midas
9/21/2007 12:57:40 PM
Thanks, I went with the case. I was just trying to be lazy. ;)

Re: Boolean formatting in report EMartinez
9/22/2007 12:36:15 AM
[quoted text, click to view]


You're welcome. Glad I could be of assistance.

Regards,

Enrique Martinez
Sr. Software Consultant
AddThis Social Bookmark Button