Wednesday, March 21, 2012

Multiple values contained in query string to be used as parameter in Report. HELP!

Hi,

I'm a bit desperate here so any solutions would be much appreciated. I'm using SQL reporting services 2005 & .NET2.0 & Oracle DB.

I need to pass multiple values in the query string, or any other suggested way, to my report to be used as a parameter. The idea is a user on the web app will do a search & select an item to open a new form.

The user can print the report from here, by pressing a button and being redirected to the report's URL. In this form there will be many (could be alot) of IDs that I will need to pass to the report and the report will use these as a parameter. The problem is that I am passing it at the moment as a comma deliminated string so instead of the SQL doing this : "ID in ('1', '2')", it's doing this: "ID in ('1, 2').

What are my alternatives? Thanks!

RS 2005 supports multi-value report parameters (e.g. http://msdn2.microsoft.com/en-us/library/aa337292.aspx).

If you use the "Oracle" data extension and write your Oracle query with a query parameter like:
select * from emp where ename IN (:EmployeeName)

RS will generate a report parameter (which you need to mark as multi-value report parameter) linked to the query parameter and perform an automatic multi-value query rewrite so that the Oracle query will be executed with correctly generated IN clause contents.

-- Robert

|||Cheers Robert.

No comments:

Post a Comment