I have added a parameter to my report with the option "Allow Multiple Values" checked.
This is a status column (IE, Proposed, In Progress, Completed, Canceled), and I want the user to be able to select which (and how many) different OrderStatus to report on.
How I normally set parameters is:
report.SetParameterValue("@dtBegin", dtBegin.DateTime);
What I tried to do for the multiple values was something like this:
//pseudo loop
foreach(int intOrderStatus in intSelectedOrderStatuses)
{
report.Parameter_OrderStatus.CurrentValues.AddValue(intOrderStatus);
}
I have checked it does add the values to the OrderStatus parameter, but when the report runs, the CrystalReports dialog pops up and asks me to enter values for the OrderStatus parameter. So it seems as though the values aren't "commited" to the parameter. I have done a number of searches and can't figure out why it's not working.
Thanks,
Just set the parameter value with an array of ints.
in the select expert you would use the in operator.
Following is tested in Crystal Reports version 13.0.20:
1) In
Parameter Fields
section add new parameter as follow:2) Choose the
Select Expert Record ...
in Crystal Reports and code may like this (use=
operator):3) Use following code:
Well i have same issue. The work around is very simple. Don't add data source after parameters. e.g
The crystal report will refresh parameters before applying data source to report. The below is the not popup discrete dialog box
Have you set the parameter to Hidden in the Crystal Reports parameter options?
What you can do is, make a normal parameter field,i.e without multiple values, only discreet values true, all you need to pass is 1,2,3,4. "," is the delimiter for separation use what ever you think works for you, then in record selection formula simply put
all you need to pass from you page is the string 1,2,3,4 and it should work
I haven't tried this, but I think that you should be able to add intOrderStatus to either a ParameterDiscreteValue or ParameterRangeValue and pass that into Parameter_OrderStatus.CurrentValues instead of intOrderStatus.