views:

5151

answers:

7

One of the many quirks of Reporting Services we've run across is the complete and utter lack of a CheckBox control or even something remotely similar.

We have a form that should appear automatically filled out based on information pulled from a database. We have several bit datatype fields. Printing out "True" or "False" just looks silly, as this is supposed to look like a form that has been auto-filled out, so we want to have a series of checkboxes and labels that are either checked or unchecked.

We are running SSRS 2005 but I'm not aware of SSRS 2008 having added a CheckBox control. Even if it did, we'd need to have an alternative for the time being. The best we've found so far is:

  1. use Wingdings
  2. use images
  3. use text boxes with borders and print a blank/space or a capital X

All three approaches require IIF expression shenanigans.

The Wingdings approach seemed to work acceptably, and was the most aesthetically pleasing except that for whatever reason it didn't always print correctly. More importantly, PDF exports, also for whatever reason, converted all fonts (generally) to Arial and so we got funky letters instead of the Windings dingbats.

Images, being a pixel-based raster, don't do so well when printed along side vector stuff like text. Unless handled carefully, they tend to stretch, pixelate, and do other unprofessional looking things.

While these methods do work (some with limitations as mentioned above) none of them are particularly elegant.

Are we missing something obvious? Not so obvious? Does someone at Microsoft have a good reason why such a control was not provided in SSRS 2000, let alone 2 versions and 8 years later? This can't be the first time this issue has come up...

+8  A: 

I, along with others in my shop, have used images, toggling the hidden attribute based on the field value (true or false). We haven't had any problems with blurring or scaling, unless we tried to increase the scale of the image beyond 100% obviously.

Another option I've used is similar to the wingdings idea, but I just use a plain old "X". On our forms at least, it is not uncommon for someone to use an X in a box instead of a check mark, so it looks completely acceptable. Plus, you don't have to worry about strange characters when printing.

As for why Microsoft does not include a checkbox control, I can't answer that as I've been wondering the same thing myself for a long time now.

NYSystemsAnalyst
A: 

I think there is a bug with SSRS and embedding font characters above 128 (some thing todo with ANSI encoding). Basically you can use 1-128 fine, the rest show up as tall rectangular blocks.

I like NY's idea of the textbox with a border and an optional X - this sounds simple and effective.

AndyM
That's ultimately what we ended up doing. Nothing else worked in all three formats: Web viewer, printed, and PDF export. I still think they should have had a checkbox control long ago. The fact that SSRS 2008 still doesn't have a good solution after 8 years of Reporting Services is unbelievable.
Yadyn
A: 

Have you ever tried adding the VS check box control to the Controls section? Haven't tried it myselft selt but am going to give it a try to see if I can add it.

Let us know if you have any success with that!
Yadyn
A: 

"....adding the VS check box control to the Controls section?" How?

Oli
This should probably have been a comment on the answer you are quoting, but regardless, I agree. I haven't a clue how to do what he's suggesting, and he never did get back to us on that...
Yadyn
+1  A: 

What I have used to display a check box (or ballot box):
1- create textbox (that will become your check box)
2- change font to Arial Unicode MS
3- in the expression window use:
ChrW(&H2611) for a filled-in checkbox
ChrW(&H2610) for an empty checkbox

Matthew
A: 

This works like a champ!

Andy
A: 

Can we use this solution to make a functioning checkbox? Scenario: we have a report where the user can filter based on whether or not a checkbox is checked or not. Right now we can only use the True/False values (very ugly for the end user).

jenny