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

            rpt.Site = this.Site;
            return(rpt);
        }
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() {
     crptMaterialreceipt rpt = new crptMaterialreceipt();
     rpt.Site = this.Site;
     return rpt;
 }
Exemplo n.º 3
0
        /// <summary>
        ///  Function to print MaterialReceipt in curresponding Crystal report
        /// </summary>
        /// <param name="dsMaterialReceiptReport"></param>
        internal void MaterialReceiptPrinting(DataSet dsMaterialReceiptReport)
        {
            try
            {
                decimal decTotalAmount = 0;
                crptMaterialreceipt crptMaterialreceiptObj = new crptMaterialreceipt();
                foreach (DataTable dtbl in dsMaterialReceiptReport.Tables)
                {
                    if (dtbl.TableName == "Table")
                    {
                        crptMaterialreceiptObj.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);
                            }
                            crptMaterialreceiptObj.Database.Tables["dtblMaterialReceiptMaster"].SetDataSource(dtbl);
                        }
                    }
                    else
                    {
                        crptMaterialreceiptObj.Database.Tables["dtblMaterialReceiptDetails"].SetDataSource(dtbl);
                    }
                }
                this.crptViewer.ReportSource = crptMaterialreceiptObj;
                SettingsSP spSettings = new SettingsSP();

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

        }