hello everyone,

I keep trying to pass several parameters to a crystal report, and what happens is the default parameters of the result show instead of my entered parameters.

Has anyone else had this issue before?

Chris


My Code is Below:

ReportDocument cryRpt = new ReportDocument();
cryRpt.Load("c:\reports\ReportName+".rpt");

ConnectionInfo c = new ConnectionInfo();
c.ServerName = GlobalStorage.Servername;
c.IntegratedSecurity = true;
c.DatabaseName = GlobalStorage.DatabaseName;

CrystalDecisions.CrystalReports.Engine.Tables CrTables = cryRpt.Database.Tables;

foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
{
CrystalDecisions.Shared.TableLogOnInfo crtableLogoninfo = CrTable.LogOnInfo;
crtableLogoninfo.ConnectionInfo = c;
CrTable.ApplyLogOnInfo(crtableLogoninfo);
}

int count = 0;

viewer.ReportSource = cryRpt;
viewer.Refresh();


ParameterFields pfields = new ParameterFields();

foreach (MyParameter p in parameters)
{
ParameterDiscreteValue crtParamDiscreteValue;
ParameterField crtParamField;
ParameterFields crtParamFields;

crtParamDiscreteValue = new ParameterDiscreteValue();
crtParamField = new ParameterField();
crtParamFields = new ParameterFields();

crtParamDiscreteValue.Value = p.parametervalue;
crtParamField.ParameterFieldName = p.parametername;
crtParamField.CurrentValues.Add(crtParamDiscreteValue);
crtParamFields.Add(crtParamField);
}

viewer.ParameterFieldInfo = pfields;

viewer.Refresh();
viewer.BringToFront();
viewer.Show();