public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { CrystalReportUsers rpt = new CrystalReportUsers(); rpt.Site = this.Site; return(rpt); }
private void RDUsers_Load(object sender, EventArgs e) { try { CrystalReportUsers ob = new CrystalReportUsers(); ByPass(ob); crystalReportViewer1.ReportSource = ob; crystalReportViewer1.Refresh(); crystalReportViewer1.Show(); } catch (Exception exp) { MessageBox.Show(exp.Message, "Exception Error"); } }
private static void ByPass(CrystalReportUsers ob) { TableLogOnInfos crtableLogoninfos = new TableLogOnInfos(); TableLogOnInfo crtableLogoninfo = new TableLogOnInfo(); ConnectionInfo crConnectionInfo = new ConnectionInfo(); Tables CrTables; crConnectionInfo.ServerName = "."; crConnectionInfo.DatabaseName = "RMSDB"; crConnectionInfo.UserID = "sa"; crConnectionInfo.Password = Variable.Class1.a; CrTables = ob.Database.Tables; foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables) { crtableLogoninfo = CrTable.LogOnInfo; crtableLogoninfo.ConnectionInfo = crConnectionInfo; CrTable.ApplyLogOnInfo(crtableLogoninfo); } }