D
Dominik Tropper
Dear all
I have created a c# web project in VS.NET 2003 that contains a crystal
report with two params. No problems until here, but executing the report
selects the wrong records.
My params are called {?PNumber} and {?PName} building a logical AND. They
are defined as 'Discrete and Range Values' with the option 'Allow multiple
values' checked. The following code snipped shows what's going on:
// load report
ReportDocument rd = new ReportDocument();
rd.Load("myReport.rpt");
ParameterDiscreteValue crDiscreteValue;
ParameterRangeValue crRangeValue;
ParameterFieldDefinition crParameter;
ParameterValues crParameterValues = new ParameterValues();
// first param
crParameter = rd.DataDefinition.ParameterFields["PNumber"];
crRangeValue = new ParameterRangeValue();
crRangeValue.StartValue = 200000;
crRangeValue.EndValue = 999000;
crParameterValues.Add(crRangeValue);
// second param
crParameter = rd.DataDefinition.ParameterFields["PName"];
crDiscreteValue = new ParameterDiscreteValue();
crDiscreteValue.Value = "LongTermWatch";
crParameterValues.Add(crDiscreteValue);
// assign params
crParameter.ApplyCurrentValues(crParameterValues);
The resultset should contain only one row, fulfilling the conditions
{?PNumber} between 200000 and 999000 and {?PName} = "LongTermWatch". Instead
the resultset shows even records whos {?PNumber} begins with 200...
And what do I have to do if I use only one of the params, say {?PNumber} =
199210, ignoring the value of {?PName}? Because of the logical AND the
resultset would be empty...
Thanks in advance
Dominik
I have created a c# web project in VS.NET 2003 that contains a crystal
report with two params. No problems until here, but executing the report
selects the wrong records.
My params are called {?PNumber} and {?PName} building a logical AND. They
are defined as 'Discrete and Range Values' with the option 'Allow multiple
values' checked. The following code snipped shows what's going on:
// load report
ReportDocument rd = new ReportDocument();
rd.Load("myReport.rpt");
ParameterDiscreteValue crDiscreteValue;
ParameterRangeValue crRangeValue;
ParameterFieldDefinition crParameter;
ParameterValues crParameterValues = new ParameterValues();
// first param
crParameter = rd.DataDefinition.ParameterFields["PNumber"];
crRangeValue = new ParameterRangeValue();
crRangeValue.StartValue = 200000;
crRangeValue.EndValue = 999000;
crParameterValues.Add(crRangeValue);
// second param
crParameter = rd.DataDefinition.ParameterFields["PName"];
crDiscreteValue = new ParameterDiscreteValue();
crDiscreteValue.Value = "LongTermWatch";
crParameterValues.Add(crDiscreteValue);
// assign params
crParameter.ApplyCurrentValues(crParameterValues);
The resultset should contain only one row, fulfilling the conditions
{?PNumber} between 200000 and 999000 and {?PName} = "LongTermWatch". Instead
the resultset shows even records whos {?PNumber} begins with 200...
And what do I have to do if I use only one of the params, say {?PNumber} =
199210, ignoring the value of {?PName}? Because of the logical AND the
resultset would be empty...
Thanks in advance
Dominik