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