Solved

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

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Hi, I am very much excited today since I'm going to share something very exciting Tool used for Analytical Reporting and that's nothing but MICROSTRATEGY. Actually there are lot of other tools available in the market for Reporting Such as Co…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
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…

806 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