Solved

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

Posted on 2007-03-19
4
324 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

910 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

25 Experts available now in Live!

Get 1:1 Help Now