Hi Guys, I have developed an application for billing purpose and My client is using Thermal Printer for Invoice Billing. My Client has WeB TH400 Thermal Printer and Whenever client go for print he has to follow this path to print
Code as below
ds.Tables.Clear(); crystalReportViewer1.Refresh(); try { adp = new SqlDataAdapter(query, con); adp.Fill(ds, "order"); adp1 = new SqlDataAdapter(query2, con); adp1.Fill(ds, "BillDetails"); ReportDocument rd = new ReportDocument(); int count = ds.Tables["BillDetails"].Rows.Count; if(count < 5) { rd.Load(Application.StartupPath + "\\crOrderReport3.rpt"); } else if(count > 10) { rd.Load(Application.StartupPath + "\\crOrderReport.rpt"); } else { rd.Load(Application.StartupPath + "\\crOrderReport1.rpt"); } rd.SetDataSource(ds.Tables["order"]); foreach(ReportObject repOp in rd.ReportDefinition.ReportObjects) { if(repOp.Kind == ReportObjectKind.SubreportObject) { string SubRepName = ((SubreportObject) repOp).SubreportName; ReportDocument subRepDoc = rd.Subreports[SubRepName]; subRepDoc.SetDataSource(ds.Tables["BillDetails"]); } } crystalReportViewer1.ToolPanelView = CrystalDecisions.Windows.Forms.ToolPanelViewType.None; crystalReportViewer1.ReportSource = rd; //crystalReportViewer1.DataBind(); } catch(Exception ex) { MessageBox.Show("Error occur during Report"); // MessageBox.Show(ex.Message); }
Thank You Akashkumar
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)