Example #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            crptRejectionOut rpt = new crptRejectionOut();

            rpt.Site = this.Site;
            return(rpt);
        }
Example #2
0
        /// <summary>
        /// Function to print RejectionOut in curresponding Crystal report
        /// </summary>
        /// <param name="dsRejectionOut"></param>
        internal void RejectionOutPrinting(DataSet dsRejectionOut)
        {

            try
            {

                crptRejectionOut crptRejectionOutObj = new crptRejectionOut();
                decimal decTotalAmount = 0;
                foreach (DataTable dtbl in dsRejectionOut.Tables)
                {
                    if (dtbl.TableName == "Table")
                    {
                        crptRejectionOutObj.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["TotalAmount"].ToString() != string.Empty)
                            {
                                decTotalAmount = Convert.ToDecimal(drow["TotalAmount"].ToString());
                                drow["AmountInWords"] = new NumToText().AmountWords(decTotalAmount, PublicVariables._decCurrencyId);
                            }
                            crptRejectionOutObj.Database.Tables["dtblRejectionOutMaster"].SetDataSource(dtbl);
                        }
                    }
                    else if (dtbl.TableName == "Table2")
                    {

                        crptRejectionOutObj.Database.Tables["dtblRejectionOutDetails"].SetDataSource(dtbl);

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

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

        }
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() {
     crptRejectionOut rpt = new crptRejectionOut();
     rpt.Site = this.Site;
     return rpt;
 }