关于水晶报表
我在Form1中输入bid,又建了个数据集,其字段有 bId ,sDate, sMoney ,然后加载到水晶报表中,在Form2_Load中间价如下代码。运行后只有表结构,没有数据?Form1 f1 = new Form1();
if (f1.bid != "")
{
string sql = "select bId ,sDate,sNum*sPrice as sMoney from sale where bId='" + f1.bid + "'";
SqlCommand cmd = DBHelper.conn.CreateCommand();
= sql;
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet1 dss = new DataSet1();
da.Fill(dss, "newsale");
CrystalReport1 cr = new CrystalReport1();
cr.SetDataSource(dss);
crystalReportViewer1.ReportSource = cr;