Solved

SRS - bind a checkbox to a database field.  The checkbox will either be checked or un-checked

Posted on 2007-03-19
4
321 Views
Last Modified: 2012-08-13
SQL.  SQL Reporting Services. SRS.  DB Reporting

I have a database field called WillCall.  This field holds either a 0 or 1.

In my report, I want to show a checkbox, and if the field has a 1, I want that checkbox to be checked, and if it is a 0 I don't want it to be checked.  How can I do this?
0
Comment
Question by:Epicmanagement
4 Comments
 
LVL 18

Expert Comment

by:chrismc
ID: 18752925
I think you will have to make it an image and supply a different graphic depending on the value,
e.g     =IIf(Fields!WillCall.Value=0, "NoTick.gif", "Tick.gif")

Cheers
Chris
0
 
LVL 27

Expert Comment

by:Sammy
ID: 18753429
you can use Convert.ToBoolean
//1 true
bool myBoolvalue = Convert.ToBoolean(1);
//0 = false
bool myBoolvalue = Convert.ToBoolean(0);
then bound your checkbox to myBoolvalue

Sammy

0
 
LVL 21

Expert Comment

by:Yurich
ID: 18753958
2sammy you can't have real checkboxes on the body of your repot - they're read only always

having an image is an option, but i think there is a bit easier way. you can set a font for your cell to wingings or webdings, which have ticked boxes, crossed boxes, filled rectangles, empty rectangles, and many other images usable for checked/unchecked representation, and then use iif to switch the images:

=iif( Fields!MyValue.Value = 1, "r", "z" )

* r and z are just for example - you'll have to find yourself what images you like more in those 4 fonts.

Good luck,
Yurich
0
 
LVL 1

Accepted Solution

by:
MayaP earned 500 total points
ID: 18775159
how about =iif( Fields!MyValue.Value = 1, "X", " " )?

also, if you want to have the border around it, you would put a code on all BorderStyles ....  
to make it solid if value = 1.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now