views:

641

answers:

2

I am trying to use URL access to pull down some reports from sql server reporting services 2008. One of the parameters I need to pass is a Guid. When I just paste the guid in to the url as

&LoggerID=CD4869DC-68B8-4513-B3C6-0E6DD9F74380

I get the error: Default value or value provided for the report parameter 'LoggerID' is not a valid value. (rsInvalidReportParameter)

I have tried single quotes and brackets and curly brackets. What am I missing?

A: 

Passing a Guid in that format to one of my own reports works fine.

I notice that your error message talks about a parameter called "LoggerID" yet your URL is using "guid" as the parameter name. It's not something simple like that?

Also note that (in my experience) SSRS URL parameters are case sensitive. If you are passing "loggerid=..." on the URL and your parameter is called "LoggerID" then you'll get an error message (although it's not the error you describe, so I doubt that's the problem).

Update

I've just had a look at the report of mine in design mode, and it actually uses "String" for the parameter type. In SSRS 2005 there isn't an option to use a Guid. That might be an option for you (change the parameter to string and cast in the query), though it'd be a bit of a hack.

Matt Hamilton
sorry my code was example. I am using correct case LoggerID in the string.
jimconstable
I assume you are using 2008?
jimconstable
No, I'm just on 2005. Perhaps the functionality has changed in 2008. Doesn't sound logical though.
Matt Hamilton
+1  A: 

It turns out that when you set the available values for a parameter as "Get values from Query" it won't accept the guid in the URL. As soon as I turn this off, it works. This only seems to be a problem for GUIDs as I am doing this with an integer and it works fine.

Related: 2008 still uses string as the parameter type.

jimconstable
I can confirm this. In my case I need to be able to open report with URL parameter or without. If param is not specified it should have a default value. My solution: create two parameters. @First is filled with query and has a default value. @Second is null by default. I can then set the @Second on from URL and use both in query using ISNULL(@Second, @First).
David Vidmar