请教 水晶报表提示字段名未知?
代码如下:
//mycon已经定义好
SqlDataAdapter myda = new SqlDataAdapter("select username,userpass from userinfo",mycon);
DataSet myds = new DataSet();
mycon.Open();
myda.Fill(myds,"userinfo");
//定义报表字段
myReport testcr= new myReport();
testcr.SetDataSource(myds);
string str="{userinfo.username}";
testcr.DataDefinition.FormulaFields["field1"].Text=str;
//指定集合
crcon1.ReportSource=testcr;
crcon1.databind();
运行后报“公式 <field1>. '{userinfo.username}' 该字段名未知。”
请问是什么情况?????????