Multi Value in RS problem
Hi, I need help please I have problem with report respectively with Multi Value in RS. 1) I have stored procedure. In stored procedure a) I have declare @rok varchar(100) b) in stored procedure in code I have " where (rok in ( @Rok, ',')) 2) In report I have a) In DATASET i have - Parameter Name: Rok / Parameter Value: =Join(Parameters!Rok.Value,",") b) In DATASET i have ROK and in query: select '2011' union all select '2010' C) IN Parameters i have ROK - Name: Rok / Prompt: Rok / Data type: text / Allow multiple values / and in Available values i have ROK 2011 and 2010 from query When I preview report and i choose ROK 2010 and 2011 , so the report ends with error An error occurred during local report processing. An error occurred during report processing. Query execution failed for dataset 'MIS'. Syntax error converting the varchar ',' to a column of data type smallint. Please help me
March 10th, 2011 4:41am

Hi, Directly u can't pass a multi value to sp.. u have to create a function for receiving values from the parameter... after u can pass this function to sp in where condition... let me knw if it is not corect.. Thanks, Naveen.P
Free Windows Admin Tool Kit Click here and download it now
March 10th, 2011 6:06am

Hi xflekacm, To use this list of comma separated values in the stored procedure we need to split them in a proper way as they are as : ‘value1, value2, value3′, but we need them as ‘value1′, ‘value2′, ‘value3′ to use them in IN clause. So we need to have a UDF function which will take this string of values and will return all them splitted. And then use them in SP as: WHERE @Color IS NULL OR Color IN (SELECT * FROM SplitList(@Color, ‘,’)) where SplitList is a UDF which takes the list and the de-limiter as input parameters and splits all the values. You could click this link Passing multi-value parameter in stored procedure (SSRS report) to get some detail reference. Below are some same threads, you could click them to learn other methods: http://social.msdn.microsoft.com/Forums/en/sqlreportingservices/thread/51baf8fc-b9dd-4ab5-920d-59760dee242f http://social.msdn.microsoft.com/Forums/en/sqlreportingservices/thread/c02370b5-aeda-47ec-a3a8-43b2ec1e6c26 If you have any question, please feel free to ask. Thanks, Challen FuPlease remember to mark the replies as answers if they help and unmark them if they provide no help.
March 17th, 2011 1:56am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics