public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { crptSalesInvoice rpt = new crptSalesInvoice(); rpt.Site = this.Site; return(rpt); }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { crptSalesInvoice rpt = new crptSalesInvoice(); rpt.Site = this.Site; return rpt; }
/// <summary> /// Function to print SalesInvoice And POS in curresponding Crystal report /// </summary> /// <param name="dsSalesInvoiceReport"></param> internal void SalesInvoicePrinting(DataSet dsSalesInvoiceReport) { try { crptSalesInvoice crptSalesInvoiceObj = new crptSalesInvoice(); decimal decTotalAmount = 0; foreach (DataTable dtbl in dsSalesInvoiceReport.Tables) { if (dtbl.TableName == "Table") { crptSalesInvoiceObj.Database.Tables["dtblCompany"].SetDataSource(dtbl); } else if (dtbl.TableName == "Table1") { foreach (DataRow drow in dtbl.Rows) { DataColumn dtClmn = new DataColumn("amountInWords"); dtbl.Columns.Add(dtClmn); if (drow["grandTotal"].ToString() != string.Empty) { decTotalAmount = Convert.ToDecimal(drow["grandTotal"].ToString()); drow["amountInWords"] = new NumToText().AmountWords(decTotalAmount, PublicVariables._decCurrencyId); } crptSalesInvoiceObj.Database.Tables["dtblSalesMaster"].SetDataSource(dtbl); } } else { crptSalesInvoiceObj.Database.Tables["dtblSalesDetails"].SetDataSource(dtbl); } } this.crptViewer.ReportSource = crptSalesInvoiceObj; SettingsSP spSettings = new SettingsSP(); if (spSettings.SettingsStatusCheck("DirectPrint") == "No") { base.Show(); this.BringToFront(); } else { crptSalesInvoiceObj.PrintToPrinter(1, false, 0, 0); } } catch (Exception ex) { MessageBox.Show("CRV20:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }