Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Missing Parameter

Status
Not open for further replies.

ProfReynolds

Programmer
Sep 12, 2001
96
US
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:

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???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top