Monday, March 26, 2012

Error when passing GUID as Parameter

Hello - I am using SSRS 2005 and my report dataset has a parameter of type
GUID. In 2000 I could just pass this in as a string. I now get the error:
"Failed to convert parameter value from a String to a Guid."
I've tried setting my Dataset parameter value as:
=Guid(Parameters!<my parameter>.Value)
and
=New Guid(Parameters!<my parameter>.Value)
and I've tried passing in my string with and without the {} braces around
the GUID string.
Anyone have the anwser here? Thank you.I have confirmed that this appears to be a bug. However, there is a
work-around:
The report in the VS report preview or when deployed will work properly with
a uniqueidentifier parameter when the value is being passed in as string. In
order to execute the dataset in your report project, temporarily modify your
stored procedure to accept the guid as a string and convert it to a
uniqueidentifier in your proc. When you execute it and get your dataset
fields to design your report, you can change it back to a uniqueidentifier
parameter.
"justinsaraceno" wrote:
> Hello - I am using SSRS 2005 and my report dataset has a parameter of type
> GUID. In 2000 I could just pass this in as a string. I now get the error:
> "Failed to convert parameter value from a String to a Guid."
> I've tried setting my Dataset parameter value as:
> =Guid(Parameters!<my parameter>.Value)
> and
> =New Guid(Parameters!<my parameter>.Value)
> and I've tried passing in my string with and without the {} braces around
> the GUID string.
> Anyone have the anwser here? Thank you.

No comments:

Post a Comment