Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
In this article I will describe the Backup & Restore 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 video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

860 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