RDLC multi string parameter filter
Not sure if this is a SQL Server Reporting Services question or an ASP.NET forum question. Anyways, I've searched many many forums, high and low, for an answer on how to filter on a multi string value parameter in a RDLC (Report Viewer) with no luck. By the way, my current config is: Visual Studio 2008, asp.net, and C#. On a web form (aspx page), I have a listbox, where users can select one or more string values and then they click a button to submit these values as a string array to a report viewer via a parameter which then renders the report. The code behind is in C# and is working. I have no problems posting the code, but I thought I would save some space here. The report parameter is set to: Name = params, Data type: = string, Hidden is checked, Multi-value is checked. Plus, I can see that the parameters are passed to the report because I have a textbox which is bound to the following: =Join(Parameters!params.Value,", ") Also, on the report, I have a List control which has a few texboxes with bound fields. And it's the List control's filter which I think is giving me problems. I suspect is it syntaxcle ( <- if that's even a word) So, If I right click on my List control, go to properties, go to the filters tab, my filter is set to this: Expression: =Fields!GraphicId.Value (Note: GraphicId is a string value Not an integer) Operator: In Value: =Join(Parameters!params.Value,", ") If I select more than one value and click the button, the report appears mostly blank (only the header and the textbox with the parameter values appear). However, if I only select one value from the list, it appears to work. I'm guessing this have something to do with my syntax or how I have the filter setup, but, I can't find a RDLC multi string parameter filter example to verify this. Thanks in advance.
December 10th, 2010 9:22pm

Best way to debug this issue is to make user of SQL Server Profiler. Select SP: Starting option under stored procedures item in the profiler and you will be able to get the procedure call which includes even the parameters. Mostly the issue would be lieing around the way how the multi select parameter is being passed. U may need to make use of dynamic SQL and have a string formatted with the parameter values passed and that should solve the issue. Please let me know if you need any further help on this. Regards,Phani Note: Please vote/mark the post as answered if it answers your question/helps to solve your problem.
Free Windows Admin Tool Kit Click here and download it now
December 11th, 2010 1:10am

Hi RedeyeCoder, If you want to pass a multi-value parameter to the report, you should pass an array of value not an string of value, here obviously Join(Parameters!params.Value,", ") return a string if you select more than one value, so please get rid of Join function. Just Parameters!params.Value is okay. Beside this, you could also add one parameter for the query to retrieve dataset rather than utilizing filters. Such as, Select * from table where columnName1 in (@ parameterName1) Here is just an example, your query might be much more complicated than this. You could also click this link to get a reference: http://forums.asp.net/p/1561893/3878775.aspx Challen Fu [MSFT] MSDN Community Support | Feedback to us Get or Request Code Sample from Microsoft Please remember to mark the replies as answers if they help and unmark them if they provide no help.
December 12th, 2010 3:29am

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

Other recent topics Other recent topics