protected void GetReport() { try { String ReportPath = ""; ReportDocument cryRpt = new ReportDocument(); TableLogOnInfos crtableLogoninfos = new TableLogOnInfos(); TableLogOnInfo crtableLogoninfo = new TableLogOnInfo(); ConnectionInfo crConnectionInfo = new ConnectionInfo(); Tables CrTables; ReportPath = Server.MapPath("\\dept.rpt"); lblrpt.Text = ReportPath; cryRpt.Load(ReportPath); crConnectionInfo.ServerName = "ITACS"; crConnectionInfo.DatabaseName = "ITAccessories"; crConnectionInfo.UserID = "sa"; crConnectionInfo.Password = "123456"; CrTables = cryRpt.Database.Tables; foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables) { crtableLogoninfo = CrTable.LogOnInfo; crtableLogoninfo.ConnectionInfo = crConnectionInfo; CrTable.ApplyLogOnInfo(crtableLogoninfo); lblrpt.Text += "\n ...*****************..."; } CrystalReportViewer1.ReportSource = cryRpt; CrystalReportViewer1.ToolPanelView = CrystalDecisions.Web.ToolPanelViewType.None; //cryRpt.PrintToPrinter(1, false, 0, 0); } catch (Exception ee) { } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)