ProfReynolds
Programmer
I have several reports which are all called through the same report viewer. They all use 2 parameters:
Parameter 1: "Remarks"
Parameter 2: "GroupID"
Parameter 2 changes based on the report, but Remarks is always present.
The code I am using to load the parameters is as follows:
This works in all but two of my reports. The two bad reports show pf (the parameter fields in the report) as only having one parameter, instead of two. This then triggers an exception that "{"Specified argument was out of the range of valid values."}"
If I look in to the local variables, pf has the "GroupID" present, but not the Remarks. If I put in a break on this line with a working report, pf has both the Remarks AND GroupID.
Any ideas???
Parameter 1: "Remarks"
Parameter 2: "GroupID"
Parameter 2 changes based on the report, but Remarks is always present.
The code I am using to load the parameters is as follows:
Code:
class ReportSetupVars
{
public string ReportPath;
public ArrayList ReportParameters = new ArrayList();
}
ReportSetupVars rsv = new ReportSetupVars();
<SNIP>
ParameterFields pf =
CrystalReportViewer1.ParameterFieldInfo;
foreach (string[] pfValue in rsv.ReportParameters)
{
ParameterField pfx;
pfx = pf[pfValue[0]];
ParameterDiscreteValue pdv = new
ParameterDiscreteValue();
pdv.Value = pfValue[1];
pfx.CurrentValues.Add(pdv);
}
This works in all but two of my reports. The two bad reports show pf (the parameter fields in the report) as only having one parameter, instead of two. This then triggers an exception that "{"Specified argument was out of the range of valid values."}"
If I look in to the local variables, pf has the "GroupID" present, but not the Remarks. If I put in a break on this line with a working report, pf has both the Remarks AND GroupID.
Any ideas???