日期:2008-06-15  浏览次数:20396 次

ReportDocument rptDoc = new ReportDocument();
            rptDoc.Load("x:\\crystalreport\\crPull.rpt");

            
            TableLOGOnInfo LOGOnInfo = new TableLOGOnInfo();
            LOGOnInfo = rptDoc.Database.Tables["tblMagUserInfo"].LOGOnInfo;
            ConnectionInfo connectionInfo = new ConnectionInfo();
            connectionInfo = LOGOnInfo.ConnectionInfo;

            connectionInfo.ServerName = "myserver";
            connectionInfo.DatabaseName = "mydb";
            connectionInfo.UserID = "myid";
            connectionInfo.Password = "mypwd";

            rptDoc.Database.Tables["tblMagUserInfo"].ApplyLOGOnInfo(LOGOnInfo);

            CrystalReportViewer1.ReportSource = rptDoc;