public void SaleInvoicePrint(DataTable dt, int vStyle) { try { objDAL.connectionstring = System.Configuration.ConfigurationManager.ConnectionStrings["MyString"].ConnectionString; DataTable dt1 = objDAL.getCompanyInfo(); if (vStyle == 0) { //CrpSaleInvoice Rpt = new CrpSaleInvoice(); CrpSaleInvoiceQE Rpt = new CrpSaleInvoiceQE(); Rpt.Database.Tables[0].SetDataSource(dt); Rpt.Database.Tables[1].SetDataSource(dt1); this.CRViewer.ReportSource = Rpt; } else if (vStyle == 1) { CrpSaleInvoiceU Rpt = new CrpSaleInvoiceU(); Rpt.Database.Tables[0].SetDataSource(dt); Rpt.Database.Tables[1].SetDataSource(dt1); this.CRViewer.ReportSource = Rpt; } else if (vStyle == 2) { CrpSaleInvoiceLH Rpt = new CrpSaleInvoiceLH(); Rpt.Database.Tables[0].SetDataSource(dt); Rpt.Database.Tables[1].SetDataSource(dt1); this.CRViewer.ReportSource = Rpt; } } catch (Exception exc) { MessageBox.Show(exc.Message, "Error"); } }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { CrpSaleInvoiceQE rpt = new CrpSaleInvoiceQE(); rpt.Site = this.Site; return(rpt); }