There is no way to pass a CR multi-value parameter to a SQL stored procedure. To pass multiple values, there are a few basic options:
1) Use a single value string parameter and have the user enter the multiple values in one string (eg. "1,2,3"). Then the procedure would have to interpret the string parameter to get the individual values.
2) If you are not using any subreports, you could make your current report a subreport, have the main report accept the multi-value parameter and then convert that to a string, and pass that string to a single-value string parameter in the subreport, which would then be passed along to the stored procedure. As above, the stored procedure would then have to interpret the string to get the individual values. The difference between this and option #1 is that with this option you're using a multi-value parameter in the report, rather than forcing the users to combine the values in one parameter (in a string like "1,2,3"). But a subreport can not contain a subreport, so this option is not available if your report needs any subreports.
3) Actually use multiple parameters in your stored procedure, one for each possible parameter value. Something like:
@Priority1 int,
@Priority2 int,
@Priority3 int,
@PartNum1 varchar(80),
@PartNum2 varchar(80),
@PartNum3 varchar(80),
@BldQty1 int,
@BldQty2 int,
@BldQty3 int
Not pretty, but it is, technically, an option.
If you have more than one parameter that allows multiple values and you have to associate the values from each parameter, so that the first value in parameter A is associated with the first value in parameter B, and so on, that complicates things a bit further, but if it's a simple one-to-one relationship and you assume that the values are always entered in the same relative order (so that you're associating value 1 with value 1, value 2 with value 2, etc.), then I don't see that as a big problem.
James
Main Topics
Browse All Topics





by: mlmccPosted on 2009-09-22 at 16:56:16ID: 25398816
To be able to do that you will have to do it in an application. Crystal really doesnt have the ability to handle multiple parameters with multiple values.
You could do a single multiple parameter like the part number as
{PartNumberField} IN {?PartumberParm}
But to associate PartNumber1 with priority and build quantity will require an application to associate the values.
mlmcc