i have a report that i have been sending a parameter to which worked just fine.
the report parameter was declared:
string[] pclist = new string(){ "A", "B", "C" };
ReportParameter pcode = new ReportParameter( "pcode", pclist, false );
which gives me a new report parameter that is initialized with a string array of 3 values. so far so good.
inside the report, the ‘pcode’ parameter is defined as a ‘String’, and is used like:
...
and PCode in ( @pcode )
...
recently, because the values for the parameter needed to change depending on who is logged in, we changed this such that the parameter gets it’s string array from the return value of a method call. (the method gets the values from the database):
ReportParameter pcode = new ReportParameter( "pcode", FetchParams("X"), false );
FetchParams(“X”) performs a select on the database and returns a string[] of values. most of the time it works fine. however, sometimes the report does not run and only returns the error message:
The 'pcode' parameter is missing a value
what we determined is that sometimes there are dozens of values be returned by FetchParams(“X”). when the number of values in the string[] gets too big, the report fails with that error message. apparently, there is some kind of upper limit to the number of values that can be used to instantiate a ReportParameter object.
initially we thought that the limitation might be in sql server itself as a limit to the number of values that can be handled by an in clause. however, the error message does not seem to support this conclusion.
edit: trial and error has shown for this particular case, 33 is the upper limit for the number of values in the string array.
does anyone have any experience with this problem?
is there an upper limit to the number of values in the array passed to the ReportParameter ctor?
is there a way to configure the upper limit to be a larger number?
any and all help will be appreciated.
thanks!
hokay, folks, here is the real answer to this bit of mystery.
the report has a parameter called ‘pcode’.
the ‘pcode’ parameter has a data source that creates a list of drop down values.
now the code that runs the report is generating a list of values for the pcode parameter.
when the list of values is passed to the report, if there is a value that doesn’t match the report’s list generated from it’s data source, you get the mind-numbing ssrs error message:
The 'pcode' parameter is missing a valueug-ly. but that’s m$ for ya.
for the record, there does not seem to be a limit to the number of values in the string array being passed to the ReportParameter ctor… that and the error message is coming from ssrs, not the code generating the ReportParameter object.
hope this might help someone else that has this problem.