public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { crptPurchaseReturn rpt = new crptPurchaseReturn(); rpt.Site = this.Site; return(rpt); }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { crptPurchaseReturn rpt = new crptPurchaseReturn(); rpt.Site = this.Site; return rpt; }
/// <summary> /// Function to print PurchaseReturn in curresponding Crystal report /// </summary> /// <param name="dsPurchaseReturnReport"></param> internal void PurchaseReturnPrinting(DataSet dsPurchaseReturnReport) { try { crptPurchaseReturn crptPurchaseReturnObj = new crptPurchaseReturn(); decimal decGrandAmount = 0; foreach (DataTable dtbl in dsPurchaseReturnReport.Tables) { if (dtbl.TableName == "Table") { crptPurchaseReturnObj.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) { decGrandAmount = Convert.ToDecimal(drow["grandTotal"].ToString()); drow["amountInWords"] = new NumToText().AmountWords(decGrandAmount, PublicVariables._decCurrencyId); } crptPurchaseReturnObj.Database.Tables["dtblPurchaseReturnMaster"].SetDataSource(dtbl); } } else { crptPurchaseReturnObj.Database.Tables["dtblPurchaseReturnDetails"].SetDataSource(dtbl); } } this.crptViewer.ReportSource = crptPurchaseReturnObj; SettingsSP spSettings = new SettingsSP(); if (spSettings.SettingsStatusCheck("DirectPrint") == "No") { base.Show(); this.BringToFront(); } else { crptPurchaseReturnObj.PrintToPrinter(1, false, 0, 0); } } catch (Exception ex) { MessageBox.Show("CRV11:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }