水晶报表,"参数不正确"
string[] fieldArray;
ParameterFields pfs = new ParameterFields();
fieldArray = DynamicPrint.fieldStr.Split( ', ');
SqlConnection con = DBT.CreateConnection();
con.Open();
SqlDataAdapter sda = new SqlDataAdapter( "select " + DynamicPrint.fieldStr + " from _Test ", con);
DataSet ds = new DataSet();
sda.Fill(ds, "_Test ");
CrystalReport3 cr = new CrystalReport3();
for (int i = 0; i < fieldArray.Length; i++)
{
ParameterField pf = new ParameterField();
pf.Name = "t " + Convert.ToString(i + 1);
ParameterDiscreteValue pdv = new ParameterDiscreteValue();
pdv.Value = fieldArray[i];
pf.CurrentValues.Add(pdv);
pfs.Add(pf);
string myStr = " ";
myStr = "tt " + Convert.ToString(i + 1);
cr.DataDefinition.FormulaFields[myStr].Text = "{_Test. " + fieldArray[i] + "} ";
}
crystalReportViewer1.ParameterFieldInfo = pfs;
&nb