4,818
社区成员
发帖
与我相关
我的任务
分享
protected void Page_Load(object sender, EventArgs e)
{
ConfigueCrystalReport();
}
private void ConfigueCrystalReport()
{
ReportDocument myReport = new ReportDocument();
TableLogOnInfo myLogInfo = new TableLogOnInfo();
string strPath = Server.MapPath("MyCrystalReport.rpt");
myReport.Load(strPath);
this.CrystalReportViewer1.ReportSource = myReport;
myLogInfo.ConnectionInfo.ServerName = "HY";
myLogInfo.ConnectionInfo.DatabaseName = "market";
myLogInfo.ConnectionInfo.UserID = "sa";
myLogInfo.ConnectionInfo.Password = "123456";
myReport.Database.Tables[0].ApplyLogOnInfo(myLogInfo);
myReport = null;
myLogInfo = null;
}