public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { crptContraVoucher rpt = new crptContraVoucher(); rpt.Site = this.Site; return(rpt); }
/// <summary> /// Function to print ContraVoucher in curresponding Crystal report /// </summary> /// <param name="dsCOntraVoucher"></param> internal void ContraVoucherPrinting(DataSet dsCOntraVoucher) { try { crptContraVoucher crptContraVoucher = new crptContraVoucher(); decimal decTotalAmount = 0; foreach (DataTable dtbl in dsCOntraVoucher.Tables) { if (dtbl.TableName == "Table") { crptContraVoucher.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); } crptContraVoucher.Database.Tables["dtblOtherDetails"].SetDataSource(dtbl); } } else if (dtbl.TableName == "Table2") { foreach (DataRow drow in dtbl.Rows) { if (drow["chequeDate"].ToString() == "01 Jan 1753") { drow["chequeDate"] = string.Empty; } } DataColumn dtClmnSlNo = new DataColumn("SlNo"); dtbl.Columns.Add(dtClmnSlNo); int inRowIndex = 0; foreach (DataRow drSlNo in dtbl.Rows) { drSlNo["SlNo"] = ++inRowIndex; } crptContraVoucher.Database.Tables["dtblGridDetails"].SetDataSource(dtbl); } } this.crptViewer.ReportSource = crptContraVoucher; SettingsSP spSettings = new SettingsSP(); if (spSettings.SettingsStatusCheck("DirectPrint") == "No") { base.Show(); this.BringToFront(); } else { crptContraVoucher.PrintToPrinter(1, false, 0, 0); } } catch (Exception ex) { MessageBox.Show("CRV5 " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { crptContraVoucher rpt = new crptContraVoucher(); rpt.Site = this.Site; return rpt; }