1, 先申明一个reportdocument对象,然后用reportdocument对象load方法载入rpt文件
2, 给定rpt文件中用到的表的登录信息
3, Crystal Report Viewer 指定报表源为上述对象
4, 绑定ReportDocument myReportDocument = new ReportDocument();
myReportDocument.Load("report1.rpt");  CrystalDecisions.Shared.TableLogOnInfo loginfo=new CrystalDecisions.Shared.TableLogOnInfo();
loginfo.ConnectionInfo.UserID="sa";
loginfo.ConnectionInfo.Password="jjz699";
myReportDocument .Database.Tables["orders"].ApplyLogOnInfo(loginfo);CrystalReportViewer1.ReportSource = myReportDocument ;CrystalReportViewer1.DataBind();