Ejemplo n.º 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            crptDeliveryNote rpt = new crptDeliveryNote();

            rpt.Site = this.Site;
            return(rpt);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///  Function to print  DeliveryNote in curresponding Crystal report
        /// </summary>
        /// <param name="dsDeliveryNote"></param>
        internal void DeliveryNotePrinting(DataSet dsDeliveryNote)
        {
            try
            {
                crptDeliveryNote crptDeliveryNoteObj = new crptDeliveryNote();
                decimal decTotalAmount = 0;
                foreach (DataTable dtbl in dsDeliveryNote.Tables)
                {
                    if (dtbl.TableName == "Table")
                    {
                        crptDeliveryNoteObj.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);
                            }
                            crptDeliveryNoteObj.Database.Tables["dtblDeliveryNoteMster"].SetDataSource(dtbl);
                        }
                    }
                    else if (dtbl.TableName == "Table2")
                    {
                        crptDeliveryNoteObj.Database.Tables["dtblDeliveryNoteDetails"].SetDataSource(dtbl);
                    }
                }
                this.crptViewer.ReportSource = crptDeliveryNoteObj;
                SettingsSP spSettings = new SettingsSP();

                if (spSettings.SettingsStatusCheck("DirectPrint") == "No")
                {
                    base.Show();
                    this.BringToFront();
                }
                else
                {
                    crptDeliveryNoteObj.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() {
     crptDeliveryNote rpt = new crptDeliveryNote();
     rpt.Site = this.Site;
     return rpt;
 }