Esempio n. 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            crptReceiptVoucher rpt = new crptReceiptVoucher();

            rpt.Site = this.Site;
            return(rpt);
        }
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() {
     crptReceiptVoucher rpt = new crptReceiptVoucher();
     rpt.Site = this.Site;
     return rpt;
 }
Esempio n. 3
0
        /// <summary>
        /// Function to print ReceiptVoucher in curresponding Crystal report
        /// </summary>
        /// <param name="dsReceiptVoucher"></param>
        internal void ReceiptVoucherPrinting(DataSet dsReceiptVoucher)
        {
            try
            {

                crptReceiptVoucher crptReceiptVoucher = new crptReceiptVoucher();
                decimal decTotalAmount = 0;
                foreach (DataTable dtbl in dsReceiptVoucher.Tables)
                {
                    if (dtbl.TableName == "Table")
                    {
                        crptReceiptVoucher.Database.Tables["dtblCompany"].SetDataSource(dtbl);
                    }
                    else if (dtbl.TableName == "Table1")
                    {

                        foreach (DataRow drow in dtbl.Rows)
                        {
                            DataColumn dtClmn = new DataColumn("Amount In Words");
                            dtbl.Columns.Add(dtClmn);
                            if (drow["totalAmount"].ToString() != string.Empty)
                            {
                                decTotalAmount = Convert.ToDecimal(drow["totalAmount"].ToString());
                                drow["Amount In Words"] = new NumToText().AmountWords(decTotalAmount, PublicVariables._decCurrencyId);
                            }
                            crptReceiptVoucher.Database.Tables["dtblReceiptMaster"].SetDataSource(dtbl);
                        }
                    }
                    else if (dtbl.TableName == "Table2")
                    {
                        foreach (DataRow drow in dtbl.Rows)
                        {

                            if (drow["chequeNo"].ToString() == string.Empty)
                            {

                                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;
                        }
                        crptReceiptVoucher.Database.Tables["dtblReceiptDetails"].SetDataSource(dtbl);
                    }

                }
                this.crptViewer.ReportSource = crptReceiptVoucher;
                SettingsSP spSettings = new SettingsSP();

                if (spSettings.SettingsStatusCheck("DirectPrint") == "No")
                {
                    base.Show();
                    this.BringToFront();
                }
                else
                {
                    crptReceiptVoucher.PrintToPrinter(1, false, 0, 0);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("CRV6 " + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }