Sunday, March 25, 2012

A WTF moment with SSRS....

...no, 'WTF' does not stand for 'Windows Transaction Framework,' LOL. I am writing to complain about what I believe is the annoying behavior of SSRS 2005 SP1. Specifically, I am trying to invoke a very simple MS SQL Server 2005 stored procedure as the data source of a report. This stored proc has an input parameter of type bit. The corresponding report parameter is type Boolean. When prompted for an input value when running the report, I enter a 0 or a 1. Much to my dismay, the SSRS IDE raises an error along the lines of '...error encountered when converting string value to Boolean.' For sake of argument, let's say that my stored proc's parameter were of the int type. I would then be prompted for a whole number parameter value, which I would be able to enter without a problem (no string-to-integer conversion error). What does SSRS not like about passing Boolean values to a stored proc that is expecting a bit? (Is the Boolean value converted to 'TRUE' or 'FALSE' under the covers?) Please advise, or I will be forced to spell out WTF....

TIA,

mattyseltz

...OK, the problem was my own stupidity. When prompted (in the SSRS IDE) for a parameter value for the input stored procedure parameter of type bit, I should have typed either 'False' or 'True', not 0 or 1. I think that is counter-intuitive, because one would execute the stored proc in Query Analyzer using a value of 0 or 1. Oh, well....

mattyseltz

|||IF you create parameter with Boolean type it should works either with False/True or 0/1. I have some reports like you describe and I was able to use False/True or 0/1. Anyway, you solve a problem, it's a main thing :)sql

No comments:

Post a Comment