日期:2014-05-20 浏览次数:21039 次
private void crystalReportViewer1_Load(object sender, EventArgs e)
{
CrystalReport1 cr = new CrystalReport1();
string sqlString = "select 姓名 from 用户名 ";
//GetData()是我写好的方法,尽管用
cr.SetDataSource(GetData(sqlString));
crystalReportViewer1.ReportSource = cr;
}
crystalReportViewer1.Subreports["ChildCrystalReport1.rpt"].SetDataSource(GetData(sqlCommand1 ));
crystalReportViewer1.Subreports["ChildCrystalReport2.rpt"].SetDataSource(GetData(sqlCommand2 ));