public void PrintMethod() { string strPath; lsInvNo = frmCustomerInv.gsInvNo; string query2 = "select InvNo from tblCustomerInvoice where InvNo='" + lsInvNo + "' and State=''"; string InvoNu = DataAccess.GetSingleValue(query2); if (InvoNu == string.Empty) { ... } else { ... } SqlDa = new SqlDataAdapter(Query, SqlCon); DataTable dt = new DataTable(); dt.Clear(); SqlDa.Fill(dt); ReportDocument REportDoct = new ReportDocument(); string reportPath = GetAppFolder(); int index = reportPath.ToLower().IndexOf("bin"); if(index >= 0) { reportPath = reportPath.Substring(0, index); } strPath = reportPath; reportPath = reportPath + @"\Reports\FinalInvoice.rpt"; REportDoct.Load(reportPath); REportDoct.SetDataSource(dt); crystalReportViewer1.ReportSource = REportDoct; crystalReportViewer1.Refresh(); REportDoct.PrintToPrinter(1, false, 0, 0); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)