public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { crptSalesReturnReporting rpt = new crptSalesReturnReporting(); rpt.Site = this.Site; return(rpt); }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { crptSalesReturnReporting rpt = new crptSalesReturnReporting(); rpt.Site = this.Site; return rpt; }
/// <summary> /// Function to print SalesReturnReport in curresponding Crystal report /// </summary> /// <param name="dsSalesReturnReportPrinting"></param> internal void SalesReturnReportPrinting(DataSet dsSalesReturnReportPrinting) { try { decimal decTotalAmount = 0; crptSalesReturnReporting crptSalesReturnReportObj = new crptSalesReturnReporting(); foreach (DataTable dtbl in dsSalesReturnReportPrinting.Tables) { if (dtbl.TableName == "Table") { crptSalesReturnReportObj.Database.Tables["dtblCompany"].SetDataSource(dtbl); } else if (dtbl.TableName == "Table1") { crptSalesReturnReportObj.Database.Tables["dtblSalesReturnMaster"].SetDataSource(dtbl); } else if (dtbl.TableName == "Table2") { 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); } crptSalesReturnReportObj.Database.Tables["dtblSalesReturnMasterGrandTotal"].SetDataSource(dtbl); } } } this.crptViewer.ReportSource = crptSalesReturnReportObj; SettingsSP spSettings = new SettingsSP(); if (spSettings.SettingsStatusCheck("DirectPrint") == "No") { base.Show(); this.BringToFront(); } else { crptSalesReturnReportObj.PrintToPrinter(1, false, 0, 0); } } catch (Exception ex) { MessageBox.Show("CRV10:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }