Quote: public void PrintReport() { ReportDocument cryRpt = new ReportDocument(); cryRpt.Load(@"C:\Users\USER\Desktop\my Activies\OldMurbad\Murbad\Murbad\RPT\PrintInvoice.rpt"); cryRpt.SetParameterValue("@IDorder", txtInvoiceNo.Text); TableLogOnInfos crtableLogoninfos = new TableLogOnInfos(); TableLogOnInfo crtableLogoninfo = new TableLogOnInfo(); ConnectionInfo crConnectionInfo = new ConnectionInfo(); Tables CrTables; crConnectionInfo.ServerName = @"DELL\SQLEXPRESS"; crConnectionInfo.DatabaseName = @"Murbad1"; crConnectionInfo.UserID = @"IBRA"; crConnectionInfo.Password = @"IBRA"; CrTables = cryRpt.Database.Tables; foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables) { crtableLogoninfo = CrTable.LogOnInfo; crtableLogoninfo.ConnectionInfo = crConnectionInfo; CrTable.ApplyLogOnInfo(crtableLogoninfo); } cryRpt.Refresh(); cryRpt.PrintToPrinter(1, true, 0, 0); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)