Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2007-03-19
4
Medium Priority
?
336 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
[X]
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
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 Ageil
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 1500 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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…
I recently went through setting up a JasperReports Server using the AWS EC2 instance, and this article will cover some basic administration tasks I had to perform.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

715 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