Monday, March 26, 2012

Parameter Error on Deployment

New to report services and trying out my first report. I have a report with a simple parameter lookup. When I preview it in Visual Studio it works fine. I can select the parameter value and it returns back the correct information.

When trying to preview the deployed version of the report I get the following error after selecting the parameter value and clicking preview. I am not sure where I need to declare the variable @.owners.

Thanks

Reporting Services Error

An error has occurred during report processing. (rsProcessingAborted) Get Online Help Query execution failed for data set 'ANDON'. (rsErrorExecutingCommand) Get Online Help ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Must declare the variable '@.Owners'.

Microsoft Reporting Services

I guess you are using @.Owner in your sql query and not defined it as a parameter for that dataset.

So in Data tab, select the dataset Edit the dataset by clicking on "..." button. and go to Paramaters tab. Type @.Owner under Name column and type "=Parameters!Owner.Value".

I'm asssuimg that Owner is already defined as one of the report parameters (Report -> Report Parameters). If not, create this parameter and then do the above.

Shyam

|||

Thanks for the response.

I have my SQL query defined as

SELECT idfld, andon, createdate, issuetype, origname, owner, notes, outcome, responded, resolution
FROM dbo.issue
WHERE (owner = @.Owner)

I went into the Data Tab/Parameters Tab and @.Owner = Parameters!Owner.value was already set

In my report parameters I have Owner defined and it is pulling information from a Select Distinct owner query.

Still works in the view mode and I still get the error when I look at the deployed report.

|||

I guess you have set Available values for your parameter from a query. Try setting a default value for your parameter.

Shyam

|||

Yes, I am getting the values for my parameter from a query. I tried setting a default value and I still get the same error.

|||

Is your parameter multi-valued?

Also check the following link:

http://msdn2.microsoft.com/en-us/library/aa337223.aspx

What is the provider type you are using on your report server and on your local machine (from visual studio)? Based on that check how you should handle as described in the link above.

Shyam

|||

"What is the provider type you are using on your report server and on your local machine (from visual studio)? "

That was the key. I had to modify the data source on the Reports Server to match what I was using on my report. Thanks!

|||make sure that the parameter is consistent throughout your code. Parameters are case sensitive - In your post, the error message referred to @.Owners - with an "s". In your posts it was referred to as @.Owner and @.owner. Reporting services sends the error when there is any difference between the report parameter in the parameter drop down and its references in the underlying code.

No comments:

Post a Comment