public ActionResult ExportData_View(decimal pAppHeaderId, string p_appCode, decimal p_View_Translate)
        {
            try
            {
                string language = AppsCommon.GetCurrentLang();

                App_Detail_PLB01_SDD_BL   objBL = new App_Detail_PLB01_SDD_BL();
                ApplicationHeaderInfo     applicationHeaderInfo = new ApplicationHeaderInfo();
                App_Detail_PLB01_SDD_Info app_Detail            = new App_Detail_PLB01_SDD_Info();
                List <AppFeeFixInfo>      appFeeFixInfos        = new List <AppFeeFixInfo>();
                List <AppDocumentInfo>    appDocumentInfos      = new List <AppDocumentInfo>();
                app_Detail = objBL.GetByID(pAppHeaderId, language, ref applicationHeaderInfo, ref appDocumentInfos, ref appFeeFixInfos);

                AppsCommon.Prepare_Data_Export_3B(ref app_Detail, applicationHeaderInfo, appDocumentInfos);
                List <App_Detail_PLB01_SDD_Info> _lst = new List <App_Detail_PLB01_SDD_Info>();
                _lst.Add(app_Detail);
                DataSet _ds_all = ConvertData.ConvertToDataSet <App_Detail_PLB01_SDD_Info>(_lst, false);
                //_ds_all.WriteXml(@"C:\inetpub\B01.xml", XmlWriteMode.WriteSchema);

                CrystalDecisions.CrystalReports.Engine.ReportDocument oRpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

                string _datetimenow = DateTime.Now.ToString("ddMMyyyyHHmm");
                string _tempfile    = "TM_PLB01SDD.rpt";
                string fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "B01_VN_" + _datetimenow + ".pdf");
                if (p_View_Translate == 1)
                {
                    // nếu là tiếng việt thì xem bản tiếng anh và ngược lại
                    if (applicationHeaderInfo.Languague_Code == Language.LangVI)
                    {
                        _tempfile    = "TM_PLB01SDD_EN.rpt"; // tiếng anh
                        fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "B01_EN_" + _datetimenow + ".pdf");
                        SessionData.CurrentUser.FilePreview = "/Content/Export/" + "B01_EN_" + _datetimenow + ".pdf";
                    }
                    else
                    {
                        fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "B01_VN_" + _datetimenow + ".pdf");
                        SessionData.CurrentUser.FilePreview = "/Content/Export/" + "B01_VN_" + _datetimenow + ".pdf";
                    }
                }
                else
                {
                    if (applicationHeaderInfo.Languague_Code == Language.LangVI)
                    {
                        fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "B01_VN_" + _datetimenow + ".pdf");
                        SessionData.CurrentUser.FilePreview = "/Content/Export/" + "B01_VN_" + _datetimenow + ".pdf";
                    }
                    else
                    {
                        _tempfile    = "TM_PLB01SDD_EN.rpt"; // tiếng anh
                        fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "B01_EN_" + _datetimenow + ".pdf");
                        SessionData.CurrentUser.FilePreview = "/Content/Export/" + "B01_EN_" + _datetimenow + ".pdf";
                    }
                }

                oRpt.Load(Path.Combine(Server.MapPath("~/Report/"), _tempfile));

                if (_ds_all != null)
                {
                    _ds_all.Tables[0].TableName = "Table";
                    // đè các bản dịch lên
                    if (p_View_Translate == 1)
                    {
                        // nếu là bản xem của thằng dịch
                        App_Translate_BL          _App_Translate_BL = new App_Translate_BL();
                        List <App_Translate_Info> _lst_translate    = _App_Translate_BL.App_Translate_GetBy_AppId(pAppHeaderId);

                        AppsCommon.Overwrite_DataSouce_Export(ref _ds_all, _lst_translate);
                    }

                    oRpt.Database.Tables["Table"].SetDataSource(_ds_all.Tables[0]);
                    //oRpt.SetDataSource(_ds_all);
                }
                oRpt.Refresh();

                Response.Buffer = false;
                Response.ClearContent();
                Response.ClearHeaders();


                System.IO.Stream oStream   = oRpt.ExportToStream(ExportFormatType.PortableDocFormat);
                byte[]           byteArray = new byte[oStream.Length];
                oStream.Read(byteArray, 0, Convert.ToInt32(oStream.Length - 1));
                System.IO.File.WriteAllBytes(fileName_pdf, byteArray.ToArray()); // Requires System.Linq

                return(Json(new { success = 0 }));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(Json(new { success = 0 }));
            }
        }
        /// <summary>
        /// 按账务期统计
        /// </summary>
        public void m_mthButtonClickToStatistic()
        {
            string p_strPriodId = "";

            clsPeriod_VO[] objPriodItems = this.m_objViewer.m_cboSelPeriod.Tag as clsPeriod_VO[];
            if (this.m_objViewer.m_cboSelPeriod.SelectedItem == null)
            {
                MessageBox.Show("请选择账务期");
                return;
            }
            if (this.m_objViewer.m_cboSelPeriod.Text != "所有财务期的数据")
            {
                p_strPriodId = objPriodItems[this.m_objViewer.m_cboSelPeriod.SelectedIndex - 1].m_strPeriodID;
            }

            DataTable dtbStatistic;
            long      lngRes = 0;

            lngRes = this.m_objManage.m_lngGetStatiticsData(out dtbStatistic, p_strPriodId);
            System.Data.DataColumn dc = new DataColumn("SEQUENCEID");
            dtbStatistic.Columns.Add(dc);
            if (dtbStatistic.Rows.Count != 0)
            {
                for (int j1 = 0; j1 < dtbStatistic.Rows.Count; j1++)
                {
                    dtbStatistic.Rows[j1]["SEQUENCEID"] = j1 + 1;
                }
            }
            if (lngRes < 0)
            {
                return;
            }
            else
            {
                CrystalDecisions.CrystalReports.Engine.ReportDocument rpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
                rpt.Load("Report\\CrystalReportHisMedInOrderStaticstic.rpt");
//					HISMedTypeManage.Rpt.CrystalReportHisMedInOrderStaticstic rpt = new HISMedTypeManage.Rpt.CrystalReportHisMedInOrderStaticstic();
                ((TextObject)rpt.ReportDefinition.ReportObjects["Text11"]).Text = this.m_objViewer.m_cboSelPeriod.SelectedText;
                double totalMoney = 0;
                if (dtbStatistic.Rows.Count > 0)
                {
                    for (int i1 = 0; i1 < dtbStatistic.Rows.Count; i1++)
                    {
                        totalMoney += Convert.ToDouble(dtbStatistic.Rows[i1]["TOLMNY_MNY"].ToString().Trim());
                    }

                    //((TextObject)rpt.ReportDefinition.ReportObjects["Text9"]).Text = totalMoney.ToString("######.00");
                }
                else
                {
                    //((TextObject)rpt.ReportDefinition.ReportObjects["Text9"]).Text = "0.00";
                }

                ((TextObject)rpt.ReportDefinition.ReportObjects["Text11"]).Text = this.m_objViewer.m_cboSelPeriod.Text;
                rpt.SetDataSource(dtbStatistic);
                rpt.Refresh();
                this.m_objViewer.m_crystalReportViewer1.ReportSource = rpt;
            }
        }
        public void m_mthFindByDateReport()
        {
            str_firstDate = m_objViewer.m_daFinDate.Value.ToShortDateString();
            str_lasttDate = m_objViewer.m_daFinDateLast.Value.ToShortDateString();


            m_rptRpt.Load("Report\\AllOPREMP_month.rpt");
            DataTable m_dtRpt       = new DataTable();
            DataTable m_dtRptDitial = new DataTable();
            long      lngRes;

            lngRes = clsDomain.m_lngChargeMnothReport(str_firstDate, str_lasttDate, out m_dtRpt);
            if (lngRes >= 1)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["txtReportTitle"]).Text = this.m_objComInfo.m_strGetHospitalTitle() + "收费处月结算表";
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["dateArear"]).Text      = "统计日期: " + str_firstDate + " 至  " + str_lasttDate;
                m_rptRpt.SetDataSource(m_dtRpt);
                m_rptRpt.Refresh();
                m_objViewer.cryReportViewer.ReportSource = m_rptRpt;
            }
        }
Exemple #4
0
        public void m_mthFindByDateReport()
        {
            str_firstDate = m_objViewer.m_daFinDate.Value.ToShortDateString();
            str_lastDate  = m_objViewer.m_daFinDateLast.Value.ToShortDateString();
            m_rptRpt.Load("Report\\rpt_medicineProtect.rpt");
            DataTable m_dtRpt       = new DataTable();
            DataTable m_dtRptDitial = new DataTable();
            long      lngRes;

            lngRes = clsDomain.m_lngMeditionProtectReport(str_firstDate, str_lastDate, out m_dtRpt);
            if (lngRes >= 1)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["acceptDate"]).Text = "就诊年月: " + Convert.ToDateTime(str_lastDate).Year + "-" + Convert.ToDateTime(str_lastDate).Month;
                //((TextObject)m_rptRpt.ReportDefinition.ReportObjects["txtReportTitle"]).Text = this.m_objComInfo.m_strGetHospitalTitle() + "医保月结算表";
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["txtReportTitle"]).Text = "城镇职工基本医疗月报表";
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["unitName"]).Text       = "单位名称: " + this.m_objComInfo.m_strGetHospitalTitle();
                m_rptRpt.SetDataSource(m_dtRpt);
                m_rptRpt.Refresh();
                m_objViewer.cryReportViewer.ReportSource = m_rptRpt;
            }
        }
Exemple #5
0
        /// <summary>
        /// 统计操作
        /// </summary>
        public void m_mthButtonClickToStatistic()
        {
            DataTable dtbStatistic;
            string    dtmStart = this.m_objViewer.m_dateTimePickerbegin.Value.ToShortDateString();
            string    dtmEnd   = this.m_objViewer.m_dateTimePickerEnd.Value.ToShortDateString();
            long      lngRes   = this.m_objManage.m_lngGetStatiticsData(dtmStart, dtmEnd, out dtbStatistic);

            if (lngRes < 0)
            {
                return;
            }
            else
            {
                CrystalDecisions.CrystalReports.Engine.ReportDocument rpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
                rpt.Load("Report\\CrystalReportOutPatient.rpt");
//				HISMedTypeManage.Rpt.CrystalReportOutPatient rpt = new HISMedTypeManage.Rpt.CrystalReportOutPatient();
                ((TextObject)rpt.ReportDefinition.ReportObjects["Text7"]).Text = this.m_objViewer.m_dateTimePickerbegin.Value.ToShortDateString();
                ((TextObject)rpt.ReportDefinition.ReportObjects["Text8"]).Text = this.m_objViewer.m_dateTimePickerEnd.Value.ToShortDateString();

                if (dtbStatistic.Rows.Count > 0)
                {
                    double totalMoney = 0;
                    for (int i1 = 0; i1 < dtbStatistic.Rows.Count; i1++)
                    {
                        totalMoney += Convert.ToDouble(dtbStatistic.Rows[i1]["TOTALMONEY"].ToString().Trim());
                    }
                    ((TextObject)rpt.ReportDefinition.ReportObjects["Text13"]).Text = totalMoney.ToString();
                }
                else
                {
                    MessageBox.Show("无统计数据!");
                    return;
                }
                //((TextObject)rpt.ReportDefinition.ReportObjects["Text13"]).Text =
                rpt.SetDataSource(dtbStatistic);
                rpt.Refresh();
                this.m_objViewer.m_crystalReportViewer1.ReportSource = rpt;
            }
        }
Exemple #6
0
        public void m_mthFindByDateReport()
        {
            str_firstDate = m_objViewer.m_daFinDate.Value.ToShortDateString();
            str_toDate    = m_objViewer.m_toDate.Value.ToShortDateString();

            m_rptRpt.Load("Report\\rptPublicPay.rpt");
            ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["txtReportTitle"]).Text = this.m_objComInfo.m_strGetHospitalTitle() + "公费费用报表";
            DataTable m_dtRpt       = new DataTable();
            DataTable m_dtRptDitial = new DataTable();

            if (m_objViewer.m_chbPatienName.Checked == true && m_objViewer.m_chbDate.Checked == true)
            {
                m_intFindType = 1;
            }
            else if (m_objViewer.m_chbPatienName.Checked == true && m_objViewer.m_chbDate.Checked == false)
            {
                m_intFindType = 2;
            }
            else if (m_objViewer.m_chbPatienName.Checked == false && m_objViewer.m_chbDate.Checked == true)
            {
                m_intFindType = 3;
            }
            else
            {
                m_intFindType = 4;
            }

            long lngRes;

            lngRes = clsDomain.m_lngPublicPayReport(m_intFindType, m_objViewer.m_txtName.Text.Trim(), str_firstDate, str_toDate, out m_dtRpt);
            if (lngRes >= 1)
            {
                m_rptRpt.SetDataSource(m_dtRpt);
                m_rptRpt.Refresh();
                m_objViewer.cryReportViewer.ReportSource = m_rptRpt;
            }
        }
Exemple #7
0
        public void m_mthFindByDateReport()
        {
            for (int i = 0; i < 17; i++)
            {
                Doe_[i] = 0;
            }

            str_firstDate = m_objViewer.m_daFinDate.Value.ToShortDateString();
            str_lasttDate = m_objViewer.m_daFinDateLast.Value.ToShortDateString();


            m_rptRpt.Load("Report\\rptDepWork.rpt");
            DataTable m_dtRpt       = new DataTable();
            DataTable m_dtRptDitial = new DataTable();
            long      lngRes;

            lngRes = clsDomain.m_lngChargeMnothReport(str_firstDate, str_lasttDate, out m_dtRpt);
            if (lngRes >= 1)
            {
                m_rptRpt.SetDataSource(m_dtRpt);
                m_rptRpt.Refresh();
                m_objViewer.cryReportViewer.ReportSource = m_rptRpt;
            }
        }
Exemple #8
0
        public void m_mthFindByDateReport()
        {
            for (int i = 3; i < 47; i++)
            {
                Doe_[i] = 0;
            }

            str_firstDate      = m_objViewer.m_daFinDate.Value.ToShortDateString();
            m_intSelectedIndex = 0;

            m_rptRpt.Load("Report\\OPREMP_day.rpt");
            ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["txtReportTitle"]).Text = this.m_objComInfo.m_strGetHospitalTitle() + "操作员日实收数报表";

            m_dtRpt       = new DataTable();
            m_dtRptDitial = new DataTable();
            long lngRes;

            if (this.m_objViewer.LoginInfo != null)
            {
                strEmployee     = this.m_objViewer.LoginInfo.m_strEmpID;
                strEmployeeName = this.m_objViewer.LoginInfo.m_strEmpName;
            }
            lngRes = clsDomain.m_lngFindByDateReport(m_intSelectedIndex, strEmployee, str_firstDate, out m_dtRpt, out m_dtRptDitial);
            if (lngRes >= 1)
            {
                for (int i = 0; i < m_dtRptDitial.Rows.Count; i++)
                {
                    #region 统计
                    switch (m_dtRptDitial.Rows[i]["ITEMCATID_CHR"].ToString().Trim())
                    {
                    case "1003":
                        Doe_[3] = Doe_[3] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1004":
                        Doe_[4] = Doe_[4] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1005":
                        Doe_[5] = Doe_[5] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1006":
                        Doe_[6] = Doe_[6] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1007":
                        Doe_[7] = Doe_[7] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1008":
                        Doe_[8] = Doe_[8] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1009":
                        Doe_[9] = Doe_[9] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1010":
                        Doe_[10] = Doe_[10] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1011":
                        Doe_[11] = Doe_[11] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1012":
                        Doe_[12] = Doe_[12] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1013":
                        Doe_[13] = Doe_[13] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1014":
                        Doe_[14] = Doe_[14] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1015":
                        Doe_[15] = Doe_[15] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1016":
                        Doe_[16] = Doe_[16] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1017":
                        Doe_[17] = Doe_[17] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1018":
                        Doe_[18] = Doe_[18] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1019":
                        Doe_[19] = Doe_[19] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1020":
                        Doe_[20] = Doe_[20] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1021":
                        Doe_[21] = Doe_[21] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1022":
                        Doe_[22] = Doe_[22] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1023":
                        Doe_[23] = Doe_[23] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1024":
                        Doe_[24] = Doe_[24] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1025":
                        Doe_[25] = Doe_[25] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1026":
                        Doe_[26] = Doe_[26] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1027":
                        Doe_[27] = Doe_[27] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1028":
                        Doe_[28] = Doe_[28] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1029":
                        Doe_[29] = Doe_[29] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1030":
                        Doe_[30] = Doe_[30] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1031":
                        Doe_[31] = Doe_[31] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1032":
                        Doe_[32] = Doe_[32] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1033":
                        Doe_[33] = Doe_[33] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1034":
                        Doe_[34] = Doe_[34] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1035":
                        Doe_[35] = Doe_[35] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1036":
                        Doe_[36] = Doe_[36] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1037":
                        Doe_[37] = Doe_[37] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1038":
                        Doe_[38] = Doe_[38] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1039":
                        Doe_[39] = Doe_[39] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1040":
                        Doe_[40] = Doe_[40] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1041":
                        Doe_[41] = Doe_[41] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1042":
                        Doe_[42] = Doe_[42] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1043":
                        Doe_[43] = Doe_[43] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1044":
                        Doe_[44] = Doe_[44] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1045":
                        Doe_[45] = Doe_[45] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;

                    case "1046":
                        Doe_[46] = Doe_[46] + Convert.ToDouble(m_dtRptDitial.Rows[i]["TOLFEE_MNY"]);
                        break;
                    }
                    #endregion
                }
            }

            #region 付值
            if (Doe_[3] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe03"]).Text = Doe_[3].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe03"]).Text = "";
            }

            if (Doe_[4] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe04"]).Text = Doe_[4].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe04"]).Text = "";
            }

            if (Doe_[5] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe05"]).Text = Doe_[5].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe05"]).Text = "";
            }

            if (Doe_[6] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe06"]).Text = Doe_[6].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe06"]).Text = "";
            }

            if (Doe_[7] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe07"]).Text = Doe_[7].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe07"]).Text = "";
            }

            if (Doe_[8] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe08"]).Text = Doe_[8].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe08"]).Text = "";
            }

            if (Doe_[9] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe09"]).Text = Doe_[9].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe09"]).Text = "";
            }

            if (Doe_[10] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe10"]).Text = Doe_[10].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe10"]).Text = "";
            }

            if (Doe_[11] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe11"]).Text = Doe_[11].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe11"]).Text = "";
            }

            if (Doe_[12] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe12"]).Text = Doe_[12].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe12"]).Text = "";
            }

            if (Doe_[13] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe13"]).Text = Doe_[13].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe13"]).Text = "";
            }

            if (Doe_[14] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe14"]).Text = Doe_[14].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe14"]).Text = "";
            }

            if (Doe_[15] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe15"]).Text = Doe_[15].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe15"]).Text = "";
            }

            if (Doe_[16] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe16"]).Text = Doe_[16].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe16"]).Text = "";
            }

            if (Doe_[17] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe17"]).Text = Doe_[17].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe17"]).Text = "";
            }

            if (Doe_[18] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe18"]).Text = Doe_[18].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe18"]).Text = "";
            }

            if (Doe_[19] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe19"]).Text = Doe_[19].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe19"]).Text = "";
            }

            if (Doe_[20] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe20"]).Text = Doe_[20].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe20"]).Text = "";
            }

            if (Doe_[21] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe21"]).Text = Doe_[21].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe21"]).Text = "";
            }

            if (Doe_[22] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe22"]).Text = Doe_[22].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe22"]).Text = "";
            }

            if (Doe_[23] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe23"]).Text = Doe_[23].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe23"]).Text = "";
            }

            if (Doe_[24] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe24"]).Text = Doe_[24].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe24"]).Text = "";
            }

            if (Doe_[25] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe25"]).Text = Doe_[25].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe25"]).Text = "";
            }

            if (Doe_[26] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe26"]).Text = Doe_[26].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe26"]).Text = "";
            }

            if (Doe_[27] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe27"]).Text = Doe_[27].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe27"]).Text = "";
            }

            if (Doe_[28] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe28"]).Text = Doe_[28].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe28"]).Text = "";
            }

            if (Doe_[29] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe29"]).Text = Doe_[29].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe29"]).Text = "";
            }

            if (Doe_[30] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe30"]).Text = Doe_[30].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe30"]).Text = "";
            }

            if (Doe_[31] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe31"]).Text = Doe_[31].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe31"]).Text = "";
            }

            if (Doe_[32] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe32"]).Text = Doe_[32].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe32"]).Text = "";
            }

            if (Doe_[33] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe33"]).Text = Doe_[33].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe33"]).Text = "";
            }

            if (Doe_[34] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe34"]).Text = Doe_[34].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe34"]).Text = "";
            }

            if (Doe_[35] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe35"]).Text = Doe_[35].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe35"]).Text = "";
            }

            if (Doe_[36] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe36"]).Text = Doe_[36].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe36"]).Text = "";
            }

            if (Doe_[37] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe37"]).Text = Doe_[37].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe37"]).Text = "";
            }

            if (Doe_[38] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe38"]).Text = Doe_[38].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe38"]).Text = "";
            }

            if (Doe_[39] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe39"]).Text = Doe_[39].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe39"]).Text = "";
            }

            if (Doe_[40] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe40"]).Text = Doe_[40].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe40"]).Text = "";
            }

            if (Doe_[41] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe41"]).Text = Doe_[41].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe41"]).Text = "";
            }

            if (Doe_[42] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe42"]).Text = Doe_[42].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe42"]).Text = "";
            }

            if (Doe_[43] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe43"]).Text = Doe_[43].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe43"]).Text = "";
            }

            if (Doe_[44] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe44"]).Text = Doe_[44].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe44"]).Text = "";
            }

            if (Doe_[45] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe45"]).Text = Doe_[45].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe45"]).Text = "";
            }

            if (Doe_[46] != 0)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe46"]).Text = Doe_[46].ToString("0.00");
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["doe46"]).Text = "";
            }
            #endregion


            ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["acceptDate"]).Text = "实收日期: " + m_objViewer.m_daFinDate.Value.ToShortDateString();


            if (m_dtRpt.Rows.Count >= 1)
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["INVOICENO"]).Text = "发票号: " + m_dtRpt.Rows[0]["INVOICENO_VCHR"].ToString().Trim() + " - " + m_dtRpt.Rows[m_dtRpt.Rows.Count - 1]["INVOICENO_VCHR"].ToString().Trim();
                this.m_objViewer.m_btnPrint.Enabled = true;
            }
            else
            {
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["INVOICENO"]).Text = "发票号: ";
            }

            m_rptRpt.SetDataSource(m_dtRpt);
            m_rptRpt.Refresh();
            m_objViewer.cryReportViewer.ReportSource = m_rptRpt;
        }
Exemple #9
0
        // <JG> 03/08/2017 externalisation méthode export PDF
        static internal void ExportPDF(string report_path, Model.Sage.Piece Piece, uint TypeDoc, String CT_Num, string temp_file)
        {
            #region PDF
            CrystalDecisions.CrystalReports.Engine.ReportDocument Etat = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

            Etat.Load(report_path);

            if (Etat.ParameterFields.Count == 0)
            {
                Etat.RecordSelectionFormula = "{Commande.DO_Piece} = '" + Piece.DO_Piece + "'";
            }

            // fonctions avec application sur les sous-états
            Core.PrintCrystal.Logon(Etat, Core.Global.GetConnectionInfos().SageServer, Core.Global.GetConnectionInfos().SageIntegratedSecurity, Core.Global.GetConnectionInfos().SageDatabase, Core.Global.GetConnectionInfos().SageSQLUser, Core.Global.GetConnectionInfos().SageSQLPass);

            Etat.Refresh();

            if (Etat.ParameterFields.Count > 0)
            {
                Etat.SetParameterValue("piece", Piece.DO_Piece);
            }

            Etat.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, temp_file);
            Etat.Close();

            if (Core.Global.GetConfig().ModuleAECInvoiceHistoryArchivePDFActive &&
                System.IO.Directory.Exists(Core.Global.GetConfig().ModuleAECInvoiceHistoryArchivePDFFolder))
            {
                string path = null;
                if (!string.IsNullOrWhiteSpace(CT_Num))
                {
                    path = System.IO.Path.Combine(Core.Global.GetConfig().ModuleAECInvoiceHistoryArchivePDFFolder, CT_Num);
                    if (!System.IO.Directory.Exists(path))
                    {
                        System.IO.Directory.CreateDirectory(path);
                    }
                    switch (TypeDoc)
                    {
                    case 1:
                        path = System.IO.Path.Combine(path, "Order");
                        break;

                    case 7:
                        path = System.IO.Path.Combine(path, "Invoice");
                        break;

                    default:
                        break;
                    }
                    if (!System.IO.Directory.Exists(path))
                    {
                        System.IO.Directory.CreateDirectory(path);
                    }

                    path = System.IO.Path.Combine(path, Piece.DO_Piece + ".pdf");
                }
                if (path != null)
                {
                    System.IO.File.Copy(temp_file, path, true);
                }
            }

            #endregion
        }
Exemple #10
0
        public void RPT_Sub(Int64 PIID, string PurchaseCode, Boolean _IsList)
        {
            mpdfFile = CurrentUser.DocumentPath + @"pdf\Purchase.pdf";
            DataTable dt = new DataTable();

            LogoBind(dt);
            //if (dgvPurchaseInvoice.CurrentRow != null)
            //{
            DataTable           dtReport = new DataTable();
            DataTable           dtTNC    = new DataTable();
            NameValueCollection para     = new NameValueCollection();

            para.Add("@i_Code", PurchaseCode);
            para.Add("@i_TNC_Sub", "Purchase");
            para.Add("@i_CompId", CurrentCompany.CompId.ToString());
            dtTNC = objDA.ExecuteDataTableSP("rpt_Purchase_TNC", para, false, ref mException, ref mErrorMsg, "Purchase TNC");
            //NameValueCollection para = new NameValueCollection();
            //para.Add("@i_RecID", Convert.ToInt64(dgvPurchaseInvoice.CurrentRow.Cells["PIID"].Value).ToString());

            //dtReport = objList.ListOfRecord("rpt_PO", para, "PurchaseInvoice - Report");
            dtReport = CommSelect.SelectRecord(PIID, "rpt_PO", "PurchaseInvoice - Report");

            if (CommSelect.Exception == null)
            {
                if (System.IO.File.Exists(CurrentUser.ReportPath + "rptPurchaseInvoice.rpt"))
                {
                    //dtblPurchaseInvoice.TableName = "PORegister";
                    //dtblPurchaseInvoice.WriteXmlSchema(@"D:\ERP-CRM\Reports Project\POL_IGMS_Reports\DataSets\PORegister.xsd");
                    CrystalDecisions.CrystalReports.Engine.ReportDocument rptDoc = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
                    rptDoc.Load(CurrentUser.ReportPath + "rptPurchaseInvoice.rpt");

                    rptDoc.Subreports[0].Database.Tables[0].SetDataSource(dtTNC);

                    rptDoc.Database.Tables[1].SetDataSource(dt);
                    rptDoc.Refresh();
                    CurrentUser.AddReportParameters(rptDoc, dtReport, "Purchase Order", true, true, true, true, true, true, true, true, true, true, false);
                    //CurrentUser.AddExtraParameter(rptDoc);
                    Reports.frmReportViewer fRptView = new Reports.frmReportViewer();
                    fRptView.Text = "Purchase Order - [Page Size: A4]";
                    fRptView.crViewer.ReportSource = rptDoc;
                    if (_IsList == true)
                    {
                        fRptView.ShowDialog();
                    }
                    else if (_IsList == false)
                    {
                        ExportOptions CrExportOptions;
                        DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
                        PdfRtfWordFormatOptions    CrFormatTypeOptions          = new PdfRtfWordFormatOptions();
                        CrDiskFileDestinationOptions.DiskFileName = mpdfFile;
                        CrExportOptions = rptDoc.ExportOptions;//Report document  object has to be given here
                        CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
                        CrExportOptions.ExportFormatType      = ExportFormatType.PortableDocFormat;
                        CrExportOptions.DestinationOptions    = CrDiskFileDestinationOptions;
                        CrExportOptions.FormatOptions         = CrFormatTypeOptions;
                        rptDoc.Export();
                    }
                }
                else
                {
                    MessageBox.Show("File is not exist...");
                }
            }
        }
Exemple #11
0
        public ActionResult ExportData_View(decimal pAppHeaderId, string p_appCode, string p_Language)
        {
            try
            {
                string _datetimenow = DateTime.Now.ToString("ddMMyyyyHHmm");
                string language = AppsCommon.GetCurrentLang();

                var objBL = new C07_BL();
                List<C07_Info_Export> _lst = new List<C07_Info_Export>();

                List<AppDocumentInfo> appDocumentInfos = new List<AppDocumentInfo>();
                List<AppFeeFixInfo> _lst_appFeeFixInfos = new List<AppFeeFixInfo>();
                ApplicationHeaderInfo applicationHeaderInfo = new ApplicationHeaderInfo();
                List<Other_MasterInfo> _lst_Other_MasterInfo = new List<Other_MasterInfo>();
                List<AppDocumentOthersInfo> _LstDocumentOthersInfo = new List<AppDocumentOthersInfo>();
                List<AppClassDetailInfo> appClassDetailInfos = new List<AppClassDetailInfo>();
                C07_Info_Export pDetail = objBL.GetByID_Exp(pAppHeaderId, language, ref applicationHeaderInfo, ref appDocumentInfos, ref _lst_appFeeFixInfos,
                    ref _lst_Other_MasterInfo, ref _LstDocumentOthersInfo, ref appClassDetailInfos);
                pDetail.LOGOURL = Server.MapPath(pDetail.LOGOURL);
                string fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "C07_VN_" + _datetimenow + ".pdf");
                if (pDetail.Languague_Code == Language.LangVI)
                {
                    fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "C07_VN_" + _datetimenow + ".pdf");
                    SessionData.CurrentUser.FilePreview = "/Content/Export/" + "C07_VN_" + _datetimenow + ".pdf";
                }
                else
                {
                    fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "C07_EN_" + _datetimenow + ".pdf");
                    SessionData.CurrentUser.FilePreview = "/Content/Export/" + "C07_EN_" + _datetimenow + ".pdf";
                }

                Prepare_Data_Export_C07(ref pDetail, applicationHeaderInfo, appDocumentInfos, _lst_appFeeFixInfos, _lst_Other_MasterInfo,
                      _LstDocumentOthersInfo, appClassDetailInfos);

                _lst.Add(pDetail);
                DataSet _ds_all = ConvertData.ConvertToDataSet<C07_Info_Export>(_lst, false);
                try
                {
                    _ds_all.WriteXml(@"C:\inetpub\C07.xml", XmlWriteMode.WriteSchema);
                }
                catch (Exception ex)
                {
                    Logger.LogException(ex);
                }
                CrystalDecisions.CrystalReports.Engine.ReportDocument oRpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

                string _tempfile = "C07.rpt";
                if (p_Language == Language.LangEN)
                {
                    _tempfile = "C07_EN.rpt";
                }
                oRpt.Load(Path.Combine(Server.MapPath("~/Report/"), _tempfile));
                #region Set vị trí ảnh

                CrystalDecisions.CrystalReports.Engine.PictureObject _pic01;
                _pic01 = (CrystalDecisions.CrystalReports.Engine.PictureObject)oRpt.ReportDefinition.Sections[0].ReportObjects["Picture1"];
                _pic01.Width = 200;
                _pic01.Height = 200;
                try
                {

                    Bitmap img = new Bitmap(pDetail.LOGOURL);
                    try
                    {

                        double _Const = 6.666666666666/2;
                        int _left = 0, _top = 0, _marginleft = 225, _margintop = 5580;
                        int _h = 600;
                        double _d1 = (_h - img.Width) / 2;
                        _d1 = _Const * _d1;
                        _left = _marginleft + Convert.ToInt32(_d1);
                        if (_left < 0)
                        {
                            _left = _marginleft;
                        }
                        _pic01.Left = _left;
                        // top

                        _d1 = (_h - img.Height) / 2;
                        _d1 = _Const * _d1;
                        _top = _margintop + Convert.ToInt32(_d1);
                        if (_top < 0)
                        {
                            _top = _margintop;
                        }
                        _pic01.Top = _top;

                    }
                    catch (Exception ex)
                    {
                        Logger.LogException(ex);
                    }
                    finally
                    {
                        img.Dispose();
                    }
                }
                catch (Exception ex)
                {


                }

                System.IO.FileInfo file = new System.IO.FileInfo(pDetail.LOGOURL);

                #endregion
                if (_ds_all != null)
                {
                    _ds_all.Tables[0].TableName = "Table";
                    oRpt.SetDataSource(_ds_all);
                }
                oRpt.Refresh();

                Response.Buffer = false;
                Response.ClearContent();
                Response.ClearHeaders();

                //oRpt.ExportToDisk(ExportFormatType.PortableDocFormat, fileName_pdf);

                System.IO.Stream oStream = oRpt.ExportToStream(ExportFormatType.PortableDocFormat);
                byte[] byteArray = new byte[oStream.Length];
                oStream.Read(byteArray, 0, Convert.ToInt32(oStream.Length - 1));
                System.IO.File.WriteAllBytes(fileName_pdf, byteArray.ToArray()); // Requires System.Linq


                return Json(new { success = 0 });
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return Json(new { success = 0 });
            }
        }
Exemple #12
0
 public void PrintToPrinter()
 {
     DEC.PrintToPrinter(1, false, 1, 1);
     DEC.Refresh();
 }
Exemple #13
0
        public ActionResult ExportData_View(decimal pAppHeaderId, string p_appCode, string p_Language)
        {
            try
            {
                string _datetimenow = DateTime.Now.ToString("ddMMyyyyHHmm");
                string language     = AppsCommon.GetCurrentLang();

                var objBL = new C08_BL();
                List <C08_Info_Export> _lst = new List <C08_Info_Export>();

                List <AppDocumentInfo>       appDocumentInfos       = new List <AppDocumentInfo>();
                List <AppFeeFixInfo>         _lst_appFeeFixInfos    = new List <AppFeeFixInfo>();
                ApplicationHeaderInfo        applicationHeaderInfo  = new ApplicationHeaderInfo();
                List <Other_MasterInfo>      _lst_Other_MasterInfo  = new List <Other_MasterInfo>();
                List <AppDocumentOthersInfo> _LstDocumentOthersInfo = new List <AppDocumentOthersInfo>();
                C08_Info_Export pDetail = objBL.GetByID_Exp(pAppHeaderId, language, ref applicationHeaderInfo, ref appDocumentInfos, ref _lst_appFeeFixInfos,
                                                            ref _lst_Other_MasterInfo, ref _LstDocumentOthersInfo);

                string fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "C08_VN_" + _datetimenow + ".pdf");
                if (pDetail.Languague_Code == Language.LangVI)
                {
                    fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "C08_VN_" + _datetimenow + ".pdf");
                    SessionData.CurrentUser.FilePreview = "/Content/Export/" + "C08_VN_" + _datetimenow + ".pdf";
                }
                else
                {
                    fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "C08_EN_" + _datetimenow + ".pdf");
                    SessionData.CurrentUser.FilePreview = "/Content/Export/" + "C08_EN_" + _datetimenow + ".pdf";
                }

                Prepare_Data_Export_C08(ref pDetail, applicationHeaderInfo, appDocumentInfos, _lst_appFeeFixInfos, _lst_Other_MasterInfo,
                                        _LstDocumentOthersInfo);

                _lst.Add(pDetail);
                DataSet _ds_all = ConvertData.ConvertToDataSet <C08_Info_Export>(_lst, false);
                try
                {
                    _ds_all.WriteXml(@"C:\inetpub\C08.xml", XmlWriteMode.WriteSchema);
                }
                catch (Exception ex)
                {
                    Logger.LogException(ex);
                }
                CrystalDecisions.CrystalReports.Engine.ReportDocument oRpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

                string _tempfile = "C08.rpt";
                if (p_Language == Language.LangEN)
                {
                    _tempfile = "C08_EN.rpt";
                }
                oRpt.Load(Path.Combine(Server.MapPath("~/Report/"), _tempfile));

                if (_ds_all != null)
                {
                    _ds_all.Tables[0].TableName = "Table";
                    oRpt.SetDataSource(_ds_all);
                }
                oRpt.Refresh();

                Response.Buffer = false;
                Response.ClearContent();
                Response.ClearHeaders();

                //oRpt.ExportToDisk(ExportFormatType.PortableDocFormat, fileName_pdf);

                System.IO.Stream oStream   = oRpt.ExportToStream(ExportFormatType.PortableDocFormat);
                byte[]           byteArray = new byte[oStream.Length];
                oStream.Read(byteArray, 0, Convert.ToInt32(oStream.Length - 1));
                System.IO.File.WriteAllBytes(fileName_pdf, byteArray.ToArray()); // Requires System.Linq


                return(Json(new { success = 0 }));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(Json(new { success = 0 }));
            }
        }
        public ActionResult ExportData_IU(ApplicationHeaderInfo pInfo, App_Detail_PLB01_SDD_Info pDetail,
                                          List <AppDocumentInfo> pAppDocumentInfo, List <AppFeeFixInfo> pFeeFixInfo)
        {
            try
            {
                string language = AppsCommon.GetCurrentLang();
                //string language = pInfo.View_Language_Report;

                string        _fileTemp = System.Web.HttpContext.Current.Server.MapPath("/Content/AppForms/B01_VI.docx");
                DocumentModel document  = DocumentModel.Load(_fileTemp);

                // Fill export_header
                AppsCommon.Prepare_Data_Export_3B(ref pDetail, pInfo, pAppDocumentInfo);
                List <App_Detail_PLB01_SDD_Info> _lst = new List <App_Detail_PLB01_SDD_Info>();
                _lst.Add(pDetail);
                DataSet _ds_all = ConvertData.ConvertToDataSet <App_Detail_PLB01_SDD_Info>(_lst, false);
                //_ds_all.Tables[0].TableName = "Table";
                //_ds_all.WriteXml(@"C:\inetpub\B01.xml", XmlWriteMode.WriteSchema);

                CrystalDecisions.CrystalReports.Engine.ReportDocument oRpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
                string _tempfile    = "TM_PLB01SDD.rpt";
                string _datetimenow = DateTime.Now.ToString("ddMMyyyyHHmm");
                string fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "B01_VN_" + _datetimenow + ".pdf");
                if (language == Language.LangVI)
                {
                    fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "B01_VN_" + _datetimenow + ".pdf");
                    SessionData.CurrentUser.FilePreview = "/Content/Export/" + "B01_VN_" + _datetimenow + ".pdf";
                }
                else
                {
                    _tempfile    = "TM_PLB01SDD_EN.rpt"; // tiếng anh
                    fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "B01_EN_" + _datetimenow + ".pdf");
                    SessionData.CurrentUser.FilePreview = "/Content/Export/" + "B01_EN_" + _datetimenow + ".pdf";
                }

                oRpt.Load(Path.Combine(Server.MapPath("~/Report/"), _tempfile));

                if (_ds_all != null)
                {
                    _ds_all.Tables[0].TableName = "Table";

                    oRpt.Database.Tables["Table"].SetDataSource(_ds_all.Tables[0]);
                    //oRpt.SetDataSource(_ds_all);
                }
                oRpt.Refresh();

                Response.Buffer = false;
                Response.ClearContent();
                Response.ClearHeaders();

                System.IO.Stream oStream   = oRpt.ExportToStream(ExportFormatType.PortableDocFormat);
                byte[]           byteArray = new byte[oStream.Length];
                oStream.Read(byteArray, 0, Convert.ToInt32(oStream.Length - 1));
                System.IO.File.WriteAllBytes(fileName_pdf, byteArray.ToArray()); // Requires System.Linq
                return(Json(new { success = 0 }));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(Json(new { success = 0 }));
            }
        }
Exemple #15
0
        public ActionResult ExportData_View_IU(ApplicationHeaderInfo pInfo, A05_Info pDetail,
                                               List <AppDocumentInfo> pAppDocumentInfo,
                                               List <AppFeeFixInfo> pFeeFixInfo,
                                               List <Other_MasterInfo> pOther_MasterInfo,
                                               List <AppClassDetailInfo> pAppClassInfo,
                                               List <AppDocumentOthersInfo> pAppDocOtherInfo
                                               )
        {
            try
            {
                string _datetimenow         = DateTime.Now.ToString("ddMMyyyyHHmm");
                string language             = AppsCommon.GetCurrentLang();
                var    objBL                = new A05_BL();
                List <A05_Info_Export> _lst = new List <A05_Info_Export>();

                string p_appCode = "A05_Preview";

                string fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "A05_VN_" + _datetimenow + ".pdf");
                if (language == Language.LangVI)
                {
                    fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "A05_VN_" + _datetimenow + ".pdf");
                    SessionData.CurrentUser.FilePreview = "/Content/Export/" + "A05_VN_" + _datetimenow + ".pdf";
                }
                else
                {
                    fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "A05_EN_" + _datetimenow + ".pdf");
                    SessionData.CurrentUser.FilePreview = "/Content/Export/" + "A05_EN_" + _datetimenow + ".pdf";
                }

                A05_Info_Export _A05_Info_Export = new A05_Info_Export();
                if (string.IsNullOrEmpty(pDetail.IMG_URL))
                {
                    pDetail.IMG_URL = pDetail.IMG_URLOrg;
                }
                if (pDetail.pfileLogo != null)
                {
                    pDetail.IMG_URL = AppLoadHelpers.PushFileToServer(pDetail.pfileLogo, AppUpload.Logo);
                }
                A05_Info_Export.CopyA05_Info(ref _A05_Info_Export, pDetail);

                _A05_Info_Export.IMG_URL = Server.MapPath(_A05_Info_Export.IMG_URL);

                // Phí cố định

                List <AppFeeFixInfo> _lstFeeFix = Call_Fee.CallFee_A05(pDetail, pAppDocumentInfo);
                Prepare_Data_Export_A05(ref _A05_Info_Export, pInfo, pAppDocumentInfo, _lstFeeFix, pOther_MasterInfo,
                                        pAppDocOtherInfo);

                _lst.Add(_A05_Info_Export);
                DataSet _ds_all = ConvertData.ConvertToDataSet <A05_Info_Export>(_lst, false);
                //_ds_all.WriteXml(@"C:\inetpub\A05.xml", XmlWriteMode.WriteSchema);
                CrystalDecisions.CrystalReports.Engine.ReportDocument oRpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

                string _tempfile = "A05.rpt";
                if (pInfo.View_Language_Report == Language.LangEN)
                {
                    _tempfile = "A05_EN.rpt";
                }
                oRpt.Load(Path.Combine(Server.MapPath("~/Report/"), _tempfile));
                #region Set vị trí ảnh

                CrystalDecisions.CrystalReports.Engine.PictureObject _pic01;
                _pic01        = (CrystalDecisions.CrystalReports.Engine.PictureObject)oRpt.ReportDefinition.Sections[0].ReportObjects["Picture1"];
                _pic01.Width  = 200;
                _pic01.Height = 200;
                try
                {
                    pDetail.IMG_URL = Server.MapPath(pDetail.IMG_URL);
                    Bitmap img = new Bitmap(pDetail.IMG_URL);
                    try
                    {
                        double _Const = 6.666666666666 / 2;
                        int    _left = 0, _top = 0, _marginleft = 225, _margintop = 3540;
                        int    _h  = 600;
                        double _d1 = (_h - img.Width) / 2;
                        _d1   = _Const * _d1;
                        _left = _marginleft + Convert.ToInt32(_d1);
                        if (_left < 0)
                        {
                            _left = _marginleft;
                        }
                        _pic01.Left = _left;
                        // top

                        _d1  = (_h - img.Height) / 2;
                        _d1  = _Const * _d1;
                        _top = _margintop + Convert.ToInt32(_d1);
                        if (_top < 0)
                        {
                            _top = _margintop;
                        }
                        _pic01.Top = _top;
                    }
                    catch (Exception ex)
                    {
                        Logger.LogException(ex);
                    }
                    finally
                    {
                        img.Dispose();
                    }
                }
                catch (Exception)
                {
                }

                System.IO.FileInfo file = new System.IO.FileInfo(pDetail.IMG_URL);

                #endregion
                if (_ds_all != null)
                {
                    _ds_all.Tables[0].TableName = "Table1";
                    oRpt.SetDataSource(_ds_all);
                }
                oRpt.Refresh();

                Response.Buffer = false;
                Response.ClearContent();
                Response.ClearHeaders();


                System.IO.Stream oStream   = oRpt.ExportToStream(ExportFormatType.PortableDocFormat);
                byte[]           byteArray = new byte[oStream.Length];
                oStream.Read(byteArray, 0, Convert.ToInt32(oStream.Length - 1));
                System.IO.File.WriteAllBytes(fileName_pdf, byteArray.ToArray()); // Requires System.Linq



                return(Json(new { success = 0 }));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(Json(new { success = 0 }));
            }
        }
        private void m_mthDepIncomrpt()
        {
            DataTable p_dtbRpt = new DataTable();
            DataTable p_depdt  = new DataTable();
            long      lngRes   = clsDomain.m_lngDepIncomerpt(m_objViewer.m_datFirstdate.Value.ToShortDateString(), m_objViewer.m_datLastdate.Value.ToShortDateString(), out p_dtbRpt, out p_depdt);

            if (lngRes > 0)
            {
                int DaySum    = 0;
                int NightSum  = 0;
                int ExpertSum = 0;
                int QuickSum  = 0;

                int intParentDay = 0, intParentNight = 0, intParentExport = 0, intParentQuick = 0;
                int intDay = 0, intNight = 0, intExport = 0, intQuick = 0;
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["fDate"]).Text = "统计日期:" + str_firstDate + " 至  " + str_lasttDate;

                DataTable m_dtbSource = new DataTable();
                m_dtbSource.Columns.Add("strComm1");
                m_dtbSource.Columns.Add("decComm1", typeof(int));
                m_dtbSource.Columns.Add("decComm2", typeof(int));
                m_dtbSource.Columns.Add("decComm3", typeof(int));
                m_dtbSource.Columns.Add("decComm4", typeof(int));
                m_dtbSource.Columns.Add("decComm5", typeof(int));
                int intPatienRow = 0;
                if (p_depdt.Rows.Count > 0)
                {
                    string tempDep = "";
                    for (int i1 = 0; i1 < p_depdt.Rows.Count; i1++)
                    {
                        if (p_depdt.Rows[i1]["code_vchr"].ToString().Trim() != "1" || p_depdt.Rows[i1]["code_vchr"].ToString().Trim() == "1")
                        {
                            #region

                            if (p_depdt.Rows[i1]["parentname_vchr"].ToString().Trim() != tempDep.Trim())
                            {
                                tempDep = p_depdt.Rows[i1]["parentname_vchr"].ToString();
                                if (i1 != 0)
                                {
                                    m_dtbSource.Rows[intPatienRow]["decComm1"] = intParentDay;
                                    m_dtbSource.Rows[intPatienRow]["decComm2"] = intParentNight;
                                    m_dtbSource.Rows[intPatienRow]["decComm3"] = intParentExport;
                                    m_dtbSource.Rows[intPatienRow]["decComm4"] = intParentQuick;
                                }

                                //DaySum += intParentDay;
                                //NightSum += intParentNight;
                                //ExpertSum += intParentExport;
                                //QuickSum += intParentQuick;

                                m_dtbSource.Rows.Add(new object[] { tempDep, intParentExport, intParentQuick, intParentNight, intParentDay, 1 });
                                intPatienRow    = m_dtbSource.Rows.Count - 1;
                                intParentExport = 0;
                                intParentQuick  = 0;
                                intParentNight  = 0;
                                intParentDay    = 0;
                            }

                            DataRow[] ArrRow = p_dtbRpt.Select("deptname_vchr='" + p_depdt.Rows[i1]["deptname_vchr"].ToString() + "'");
                            intExport = 0;
                            intQuick  = 0;
                            intNight  = 0;
                            intDay    = 0;
                            foreach (DataRow dr in ArrRow)
                            {
                                if (dr["registertypeid_chr"].ToString().Trim() == "0002")  //专家号
                                {
                                    #region MyRegion

                                    if (dr["flag_int"].ToString().Trim() == "3")  //退票
                                    {
                                        intExport--;
                                    }
                                    else  //正常 还原
                                    {
                                        intExport++;
                                    }
                                    #endregion
                                }
                                else if (dr["registertypeid_chr"].ToString().Trim() == "0003")  //急诊号
                                {
                                    #region MyRegion

                                    if (dr["flag_int"].ToString().Trim() == "3")  //退票
                                    {
                                        intQuick--;
                                    }
                                    else  //正常 还原
                                    {
                                        intQuick++;
                                    }
                                    #endregion
                                }
                                else  //普通号
                                {
                                    #region MyRegion

                                    if (dr["flag_int"].ToString().Trim() == "3")  //退票
                                    {
                                        if (dr["planperiod_chr"].ToString().Trim() == "晚上")
                                        {
                                            intNight--;
                                        }
                                        else
                                        {
                                            intDay--;
                                        }
                                    }
                                    else  // 正常 还原
                                    {
                                        if (dr["planperiod_chr"].ToString().Trim() == "晚上")
                                        {
                                            intNight++;
                                        }
                                        else
                                        {
                                            intDay++;
                                        }
                                    }
                                    #endregion
                                }
                            }
                            m_dtbSource.Rows.Add(new object[] { " " + p_depdt.Rows[i1]["DEPTNAME_VCHR"].ToString(), intDay, intNight, intExport, intQuick, 0 });

                            intParentExport += intExport;
                            intParentQuick  += intQuick;
                            intParentNight  += intNight;
                            intParentDay    += intDay;

                            DaySum    += intDay;
                            NightSum  += intNight;
                            ExpertSum += intExport;
                            QuickSum  += intQuick;
                            #endregion
                        }
                        else
                        {
                            tempDep = "";
                            DataRow[] seleRow = p_depdt.Select("PARENTNAME_VCHR='" + p_depdt.Rows[i1]["deptname_vchr"].ToString() + "'");
                            if (seleRow.Length == 0)
                            {
                                DataRow[] ArrRow = p_dtbRpt.Select("deptname_vchr='" + p_depdt.Rows[i1]["deptname_vchr"].ToString() + "'");
                                intExport = 0;
                                intQuick  = 0;
                                intNight  = 0;
                                intDay    = 0;
                                foreach (DataRow dr in ArrRow)
                                {
                                    if (dr["registertypeid_chr"].ToString().Trim() == "0002")  //专家号
                                    {
                                        #region MyRegion

                                        if (dr["flag_int"].ToString().Trim() == "3")  //退票
                                        {
                                            intExport--;
                                        }
                                        else  //正常 还原
                                        {
                                            intExport++;
                                        }
                                        #endregion
                                    }
                                    else if (dr["registertypeid_chr"].ToString().Trim() == "0003")  //急诊号
                                    {
                                        #region MyRegion

                                        if (dr["flag_int"].ToString().Trim() == "3")  //退票
                                        {
                                            intQuick--;
                                        }
                                        else  //正常 还原
                                        {
                                            intQuick++;
                                        }
                                        #endregion
                                    }
                                    else  //普通号
                                    {
                                        #region MyRegion

                                        if (dr["flag_int"].ToString().Trim() == "3")  //退票
                                        {
                                            if (dr["planperiod_chr"].ToString().Trim() == "晚上")
                                            {
                                                intNight--;
                                            }
                                            else
                                            {
                                                intDay--;
                                            }
                                        }
                                        else  // 正常 还原
                                        {
                                            if (dr["planperiod_chr"].ToString().Trim() == "晚上")
                                            {
                                                intNight++;
                                            }
                                            else
                                            {
                                                intDay++;
                                            }
                                        }
                                        #endregion
                                    }
                                }
                                m_dtbSource.Rows.Add(new object[] { p_depdt.Rows[i1]["DEPTNAME_VCHR"].ToString(), intDay, intNight, intExport, intQuick, 0 });

                                intParentExport += intExport;
                                intParentQuick  += intQuick;
                                intParentNight  += intNight;
                                intParentDay    += intDay;

                                DaySum    += intDay;
                                NightSum  += intNight;
                                ExpertSum += intExport;
                                QuickSum  += intQuick;
                            }
                        }
                    }
                }
                m_dtbSource.Rows[intPatienRow]["decComm1"] = intParentDay;
                m_dtbSource.Rows[intPatienRow]["decComm2"] = intParentNight;
                m_dtbSource.Rows[intPatienRow]["decComm3"] = intParentExport;
                m_dtbSource.Rows[intPatienRow]["decComm4"] = intParentQuick;
                m_rptRpt.SetDataSource(m_dtbSource);
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["txtDaySum"]).Text    = DaySum.ToString();
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["txtNightSum"]).Text  = NightSum.ToString();
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["txtComSum"]).Text    = Convert.ToString(DaySum + NightSum);
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["txtExpertSum"]).Text = ExpertSum.ToString();
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["txtQuickSum"]).Text  = QuickSum.ToString();
                ((TextObject)m_rptRpt.ReportDefinition.ReportObjects["txtTotal"]).Text     = Convert.ToString(DaySum + NightSum + ExpertSum + QuickSum);

                m_rptRpt.Refresh();
                m_objViewer.cryReportViewer.ReportSource = m_rptRpt;
                m_dtbSource = null;
            }
            else
            {
                MessageBox.Show("加载数据时出错!!", "iCare", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return;
        }
Exemple #17
0
        public ActionResult ExportData_View_IU(ApplicationHeaderInfo pInfo, Pattent_Lao_Info pDetail,
                                               List <AppDocumentInfo> pAppDocumentInfo, List <AppFeeFixInfo> pFeeFixInfo,
                                               List <Other_MasterInfo> pOther_MasterInfo,
                                               List <Inventor_Info> pInventor_Info,
                                               List <AppClassDetailInfo> pAppClassInfo, List <AppDocumentOthersInfo> pAppDocOtherInfo,
                                               List <UTienInfo> pUTienInfo, List <AppDocumentOthersInfo> pLstImagePublic)
        {
            try
            {
                string _datetimenow = DateTime.Now.ToString("ddMMyyyyHHmm");
                string language     = AppsCommon.GetCurrentLang();
                //var objBL = new A01_BL();
                List <Pattent_Lao_Info_Export> _lst = new List <Pattent_Lao_Info_Export>();

                string fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "L_Patent_VN_" + _datetimenow + ".pdf");
                if (language == Language.LangVI)
                {
                    fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "L_Patent_VN_" + _datetimenow + ".pdf");
                    SessionData.CurrentUser.FilePreview = "/Content/Export/" + "L_Patent_VN_" + _datetimenow + ".pdf";
                }
                else
                {
                    fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "L_Patent_EN_" + _datetimenow + ".pdf");
                    SessionData.CurrentUser.FilePreview = "/Content/Export/" + "L_Patent_EN_" + _datetimenow + ".pdf";
                }

                Pattent_Lao_Info_Export _A01_Info_Export = new Pattent_Lao_Info_Export();
                Pattent_Lao_Info_Export.CopyA01_Info(ref _A01_Info_Export, pDetail);

                foreach (var item in MemoryData.c_lst_Country)
                {
                    if (item.Country_Id == pInfo.Master_Country_Nationality)
                    {
                        pInfo.Master_Country_Nationality_Name = item.Name;
                    }
                    if (item.Country_Id == pInfo.Master_Country_Incorporation)
                    {
                        pInfo.Master_Country_Incorporation_Name = item.Name;
                    }
                    if (item.Country_Id == pInfo.Master_Country_Residence)
                    {
                        pInfo.Master_Country_Residence_Name = item.Name;
                    }
                }


                // Phí cố định
                List <AppFeeFixInfo> _lstFeeFix = Call_Fee.CallFee_PT_Lao(pDetail, pAppDocumentInfo, pUTienInfo, pLstImagePublic, pAppDocOtherInfo);

                Call_Fee.Prepare_Data_Export_PT_Lao(ref _A01_Info_Export, pInfo, pAppDocumentInfo, _lstFeeFix, pInventor_Info, pOther_MasterInfo,
                                                    pAppClassInfo, pAppDocOtherInfo, pUTienInfo, pLstImagePublic);

                _lst.Add(_A01_Info_Export);
                DataSet _ds_all = ConvertData.ConvertToDataSet <Pattent_Lao_Info_Export>(_lst, false);
                //_ds_all.WriteXml(@"D:\A01.xml", XmlWriteMode.WriteSchema);
                CrystalDecisions.CrystalReports.Engine.ReportDocument oRpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

                string _tempfile = "L_Patent.rpt";
                //if (language == Language.LangEN)
                //{
                //    _tempfile = "L_Patent_EN.rpt";
                //}
                oRpt.Load(Path.Combine(Server.MapPath("~/Report/"), _tempfile));

                if (_ds_all != null)
                {
                    _ds_all.Tables[0].TableName = "Table1";
                    oRpt.Database.Tables["Table"].SetDataSource(_ds_all.Tables[0]);
                    //oRpt.SetDataSource(_ds_all);
                }
                oRpt.Refresh();

                Response.Buffer = false;
                Response.ClearContent();
                Response.ClearHeaders();

                //oRpt.ExportToDisk(ExportFormatType.PortableDocFormat, fileName_pdf);

                System.IO.Stream oStream   = oRpt.ExportToStream(ExportFormatType.PortableDocFormat);
                byte[]           byteArray = new byte[oStream.Length];
                oStream.Read(byteArray, 0, Convert.ToInt32(oStream.Length - 1));
                System.IO.File.WriteAllBytes(fileName_pdf, byteArray.ToArray()); // Requires System.Linq

                return(Json(new { success = 0 }));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(Json(new { success = 0 }));
            }
        }
Exemple #18
0
        public ActionResult ExportData_View_IU(ApplicationHeaderInfo pInfo, A02_Info pDetail,
                                               List <AppDocumentInfo> pAppDocumentInfo, List <AppFeeFixInfo> pFeeFixInfo,
                                               List <AuthorsInfo> pAppAuthorsInfo, List <Other_MasterInfo> pOther_MasterInfo,
                                               List <AppClassDetailInfo> pAppClassInfo, List <AppDocumentOthersInfo> pAppDocOtherInfo,
                                               List <UTienInfo> pUTienInfo, List <AppDocumentOthersInfo> pAppDocDesign)
        {
            try
            {
                string _datetimenow         = DateTime.Now.ToString("ddMMyyyyHHmm");
                string language             = AppsCommon.GetCurrentLang();
                var    objBL                = new A02_BL();
                List <A02_Info_Export> _lst = new List <A02_Info_Export>();

                string p_appCode = "A02_Preview";

                string fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "A02_VN_" + _datetimenow + ".pdf");
                if (language == Language.LangVI)
                {
                    fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "A02_VN_" + _datetimenow + ".pdf");
                    SessionData.CurrentUser.FilePreview = "/Content/Export/" + "A02_VN_" + _datetimenow + ".pdf";
                }
                else
                {
                    fileName_pdf = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "A02_EN_" + _datetimenow + ".pdf");
                    SessionData.CurrentUser.FilePreview = "/Content/Export/" + "A02_EN_" + _datetimenow + ".pdf";
                }

                A02_Info_Export _A02_Info_Export = new A02_Info_Export();
                A02_Info_Export.CopyA02_Info(ref _A02_Info_Export, pDetail);


                // Phí cố định

                List <AppFeeFixInfo> _lstFeeFix = Call_Fee.CallFee_A02(pDetail, pAppDocumentInfo, pAppDocDesign);
                Prepare_Data_Export_A02(ref _A02_Info_Export, pInfo, pAppDocumentInfo, _lstFeeFix, pAppAuthorsInfo, pOther_MasterInfo,
                                        pAppDocOtherInfo, pAppDocDesign);

                _lst.Add(_A02_Info_Export);
                DataSet _ds_all = ConvertData.ConvertToDataSet <A02_Info_Export>(_lst, false);
                //_ds_all.WriteXml(@"C:\inetpub\A02.xml", XmlWriteMode.WriteSchema);
                CrystalDecisions.CrystalReports.Engine.ReportDocument oRpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

                string _tempfile = "A02.rpt";
                if (language == Language.LangEN)
                {
                    _tempfile = "A02_EN.rpt";
                }
                oRpt.Load(Path.Combine(Server.MapPath("~/Report/"), _tempfile));

                if (_ds_all != null)
                {
                    _ds_all.Tables[0].TableName = "Table1";
                    oRpt.SetDataSource(_ds_all);
                }
                oRpt.Refresh();

                Response.Buffer = false;
                Response.ClearContent();
                Response.ClearHeaders();


                System.IO.Stream oStream   = oRpt.ExportToStream(ExportFormatType.PortableDocFormat);
                byte[]           byteArray = new byte[oStream.Length];
                oStream.Read(byteArray, 0, Convert.ToInt32(oStream.Length - 1));
                System.IO.File.WriteAllBytes(fileName_pdf, byteArray.ToArray()); // Requires System.Linq

                return(Json(new { success = 0 }));
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return(Json(new { success = 0 }));
            }
        }
Exemple #19
0
        public void RPT_Sub(Int64 QuotationID, string Code, Boolean _IsList)
        {
            DataTable dt = new DataTable();

            LogoBind(dt);
            mpdfFile = CurrentUser.DocumentPath + @"pdf\Quotation.pdf";
            DataTable dtReport = new DataTable();

            dtReport = CommSelect.SelectRecord(QuotationID, "rpt_Quotation", "Quotation - Report");

            DataTable           dtTNC = new DataTable();
            NameValueCollection para  = new NameValueCollection();

            para.Add("@i_Code", Code);
            para.Add("@i_TNC_Sub", "Quotation");

            dtTNC = objDA.ExecuteDataTableSP("rpt_Quotation_TNC", para, false, ref mException, ref mErrorMsg, "Quotation TNC");

            DataTable dtCompany = new DataTable();

            dtCompany = objDA.ExecuteDataTableSP("rpt_Company", null, false, ref mException, ref mErrorMsg, "Quotation TNC");
            //dtReport.TableName = "Quotation";
            //dtReport.WriteXmlSchema(@"D:\Quotation.xsd");

            if (CommSelect.Exception == null)
            {
                //if (TypeOFSale == "AMC")
                //{
                //    if (System.IO.File.Exists(CurrentUser.ReportPath + "rptQuotation_AMC.rpt"))
                //    {

                //        CrystalDecisions.CrystalReports.Engine.ReportDocument rptDoc = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
                //        rptDoc.Load(CurrentUser.ReportPath + "rptQuotation_AMC.rpt");

                //        //rptDoc.SetDatabaseLogon("sa", "Un!ek3RP");
                //        CurrentUser.AddReportParameters(rptDoc, dtReport, "", false, false, false, false, false, false, false, false, false, false, false);

                //        rptDoc.Database.Tables[1].SetDataSource(dtCompany);
                //        rptDoc.Subreports[0].DataSourceConnections.Clear();
                //        rptDoc.Subreports[0].Database.Tables[0].SetDataSource(dtTNC);
                //        rptDoc.Refresh();


                //        Reports.frmReportViewer fRptView = new Reports.frmReportViewer();
                //        fRptView.Text = "Quotation - [Page Size: A4]";
                //        fRptView.crViewer.ReportSource = rptDoc;
                //        if (_IsList == true)
                //        {
                //            fRptView.ShowDialog();
                //        }
                //        else if (_IsList == false)
                //        {
                //            ExportOptions CrExportOptions;
                //            DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
                //            PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions();
                //            CrDiskFileDestinationOptions.DiskFileName = mpdfFile;
                //            CrExportOptions = rptDoc.ExportOptions;//Report document  object has to be given here
                //            CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
                //            CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
                //            CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions;
                //            CrExportOptions.FormatOptions = CrFormatTypeOptions;
                //            rptDoc.Export();

                //        }
                //    }
                //    else
                //    {
                //        MessageBox.Show("File is not exist...");
                //    }
                //}
                //else if (TypeOFSale != "AMC")
                //{
                if (System.IO.File.Exists(CurrentUser.ReportPath + "rptQuotation.rpt"))
                {
                    CrystalDecisions.CrystalReports.Engine.ReportDocument rptDoc = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
                    rptDoc.Load(CurrentUser.ReportPath + "rptQuotation.rpt");
                    //rptDoc.Subreports[0].DataSourceConnections.Clear();
                    rptDoc.Subreports[0].Database.Tables[0].SetDataSource(dtTNC);

                    rptDoc.Database.Tables[1].SetDataSource(dtCompany);
                    rptDoc.Database.Tables[2].SetDataSource(dt);
                    rptDoc.Refresh();
                    CurrentUser.AddReportParameters(rptDoc, dtReport, "", false, false, false, false, false, false, false, false, false, false, false);
                    CurrentUser.AddExtraParameter(rptDoc);
                    if (CurrentCompany.Com_Profile != null || CurrentCompany.Com_Profile.Trim() != "")
                    {
                        rptDoc.SetParameterValue("pCompanyProfile", CurrentCompany.Com_Profile);
                    }
                    Reports.frmReportViewer fRptView = new Reports.frmReportViewer();
                    fRptView.Text = "Quotation - [Page Size: A4]";
                    fRptView.crViewer.ReportSource = rptDoc;

                    if (_IsList == true)
                    {
                        fRptView.ShowDialog();
                    }
                    else if (_IsList == false)
                    {
                        ExportOptions CrExportOptions;
                        DiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions();
                        PdfRtfWordFormatOptions    CrFormatTypeOptions          = new PdfRtfWordFormatOptions();
                        CrDiskFileDestinationOptions.DiskFileName = mpdfFile;
                        CrExportOptions = rptDoc.ExportOptions;//Report document  object has to be given here
                        CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
                        CrExportOptions.ExportFormatType      = ExportFormatType.PortableDocFormat;
                        CrExportOptions.DestinationOptions    = CrDiskFileDestinationOptions;
                        CrExportOptions.FormatOptions         = CrFormatTypeOptions;
                        rptDoc.Export();
                    }
                }
                else
                {
                    MessageBox.Show("File is not exist...");
                }
                //}
            }
        }
Exemple #20
0
        private void m_btnFind_Click(object sender, EventArgs e)
        {
            if (m_lsv.Items.Count == 1)
            {
                MessageBox.Show("没有配置好药房数据,请联系管理员", "错误");
                return;
            }

            #region 取得相关条件
            int    intSelCount = 0;
            string strDep      = "";
            int    index       = 0;
            for (int i = 1; i < m_lsv.Items.Count; i++)
            {
                if (m_lsv.Items[i].Checked)
                {
                    intSelCount++;
                }
            }
            string[] strMedStoreIDArr = null;

            if (m_lsv.Items[0].Checked)
            {
                strMedStoreIDArr = new string[m_lsv.Items.Count - 1];
                for (int i = 1; i < m_lsv.Items.Count; i++)
                {
                    strMedStoreIDArr[i - 1] = m_lsv.Items[i].SubItems[1].Text;
                    strDep += m_lsv.Items[i].SubItems[0].Text + " ";
                }
            }
            else
            {
                strMedStoreIDArr = new string[intSelCount];
                for (int i = 1; i < m_lsv.Items.Count; i++)
                {
                    if (m_lsv.Items[i].Checked)
                    {
                        strMedStoreIDArr[index++] = m_lsv.Items[i].SubItems[1].Text;
                        strDep += m_lsv.Items[i].SubItems[0].Text + " ";
                    }
                }
            }

            if (strDep == "")
            {
                MessageBox.Show("请选择统计药房", "错误", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            //未配1
            //已配2
            //已发3
            string[] strStatusArr = null;
            if (m_cboState.Text == "全部")
            {
                strStatusArr = new string[] { "1", "2", "3" }
            }
            ;
            else if (m_cboState.Text == "未配")
            {
                strStatusArr = new string[] { "1" };
            }
            else if (m_cboState.Text == "已配")
            {
                strStatusArr = new string[] { "2" };
            }
            else if (m_cboState.Text == "已发")
            {
                strStatusArr = new string[] { "3" };
            }
            #endregion

            #region order by
            string strASC = " ASC ";
            if (m_cboAsc.Text != "升序")
            {
                strASC = " DESC ";
            }
            string strOrder = " " + m_strGetColName(m_cbocol.Text) + " " + strASC;
            #endregion
            string strRPT = "";
            long   lngRes = 0;
            switch (m_cboRptSel.SelectedIndex)
            {
            case  0:
            case  2:

                #region 配置报表
                strRPT = "cryMedSendDetails.rpt";
                m_rptRpt.Load("Report\\" + strRPT);

                lngRes = m_objSvc.m_lngGetMedSendItemData(m_dtmStart.Value.ToShortDateString(),
                                                          m_dtmEnd.Value.ToShortDateString(), strMedStoreIDArr, strStatusArr, strOrder, m_ctlTBFindItem.txtValuse.Trim(), out m_DataTable);
                //DataRow[] drArr = m_DataTable.Select(" OUTPATRECIPEID_CHR is not null ", strOrder);
                //m_DataTable.Rows.Clear();
                //for (int i = 0; i < drArr.Length; i++)
                //{
                //    m_DataTable.Rows.Add(drArr[i]);
                //}
                if (m_cboRptSel.SelectedIndex == 2)
                {
                    TextObject m_sendman = m_rptRpt.ReportDefinition.ReportObjects["m_sendman"] as TextObject;
                    m_sendman.Text = "发料人";
                    TextObject m_setman = m_rptRpt.ReportDefinition.ReportObjects["m_setman"] as TextObject;
                    m_setman.Text = "配料人";
                    TextObject m_title = m_rptRpt.ReportDefinition.ReportObjects["m_title"] as TextObject;
                    m_title.Text = "门诊综合材料发放清单(明细)";
                }
                else if (m_cboRptSel.SelectedIndex == 0)
                {
                    TextObject m_sendman = m_rptRpt.ReportDefinition.ReportObjects["m_sendman"] as TextObject;
                    m_sendman.Text = "发药人";
                    TextObject m_setman = m_rptRpt.ReportDefinition.ReportObjects["m_setman"] as TextObject;
                    m_setman.Text = "配药人";
                    TextObject m_title = m_rptRpt.ReportDefinition.ReportObjects["m_title"] as TextObject;
                    m_title.Text = "门诊药房药品发放清单(明细)";
                }

                TextObject m_PrintDate = m_rptRpt.ReportDefinition.ReportObjects["m_PrintDate"] as TextObject;
                m_PrintDate.Text = System.DateTime.Now.ToString();
                TextObject m_state = m_rptRpt.ReportDefinition.ReportObjects["m_state"] as TextObject;
                m_state.Text = m_cboState.Text;
                TextObject m_dept = m_rptRpt.ReportDefinition.ReportObjects["m_dept"] as TextObject;
                m_dept.Text = strDep;
                TextObject m_statis = m_rptRpt.ReportDefinition.ReportObjects["m_statis"] as TextObject;
                m_statis.Text = m_dtmStart.Value.ToShortDateString() + " ~ " + m_dtmEnd.Value.ToShortDateString();
                double dblTotal = 0;
                string str      = "";
                for (int i = 0; i < m_DataTable.Rows.Count; i++)
                {
                    str = m_DataTable.Rows[i]["tolprice_mny"].ToString();
                    if (str != "")
                    {
                        dblTotal += double.Parse(str);
                    }
                }
                TextObject m_total = m_rptRpt.ReportDefinition.ReportObjects["m_total"] as TextObject;
                m_total.Text = dblTotal.ToString();
                #endregion

                if (lngRes > 0)
                {
                    m_rptRpt.SetDataSource(m_DataTable);
                    m_rptRpt.Refresh();
                    crystalReportViewer1.ReportSource = m_rptRpt;
                }
                else
                {
                    MessageBox.Show("查找数据库出错.");
                }
                break;

            case 1:
            case 3:
                #region 配置报表
                strRPT = "cryMedSum.rpt";
                m_rptRpt.Load("Report\\" + strRPT);

                lngRes = m_objSvc.m_lngGetMedSendItemData(m_dtmStart.Value.ToShortDateString(),
                                                          m_dtmEnd.Value.ToShortDateString(), strMedStoreIDArr, strStatusArr, strOrder, m_ctlTBFindItem.txtValuse.Trim(), out m_DataTable);

                TextObject m_title2 = m_rptRpt.ReportDefinition.ReportObjects["m_title"] as TextObject;
                if (m_cboRptSel.SelectedIndex == 1)
                {
                    m_title2.Text = "门诊药房药品发放清单(汇总)";
                }
                else
                {
                    m_title2.Text = "门诊综合材料发放清单(汇总)";
                }


                TextObject m_PrintDate2 = m_rptRpt.ReportDefinition.ReportObjects["m_PrintDate"] as TextObject;
                m_PrintDate2.Text = System.DateTime.Now.ToString();
                TextObject m_state2 = m_rptRpt.ReportDefinition.ReportObjects["m_state"] as TextObject;
                m_state2.Text = m_cboState.Text;
                TextObject m_dept2 = m_rptRpt.ReportDefinition.ReportObjects["m_dept"] as TextObject;
                m_dept2.Text = strDep;
                TextObject m_statis2 = m_rptRpt.ReportDefinition.ReportObjects["m_statis"] as TextObject;
                m_statis2.Text = m_dtmStart.Value.ToShortDateString() + " ~ " + m_dtmEnd.Value.ToShortDateString();
                #endregion

                if (lngRes > 0)
                {
                    DataTable dtTemp   = m_DataTable.Clone();
                    DataRow   dr       = null;
                    DataRow[] drarr    = null;
                    string    itemid   = "";
                    int       indexHas = -1;
                    bool      blnHas   = false;
                    if (m_DataTable != null)
                    {
                        for (int i = 0; i < m_DataTable.Rows.Count; i++)
                        {
                            blnHas = false;
                            itemid = m_DataTable.Rows[i]["strTemp1"].ToString().Trim();

                            for (int i2 = 0; i2 < dtTemp.Rows.Count; i2++)
                            {
                                if (itemid == dtTemp.Rows[i2]["strTemp1"].ToString().Trim())
                                {
                                    blnHas   = true;
                                    indexHas = i2;
                                    break;
                                }
                            }
                            if (blnHas)
                            {
                                dtTemp.Rows[indexHas]["qty_dec"]      = Math.Ceiling(double.Parse(dtTemp.Rows[indexHas]["qty_dec"].ToString().Trim())) + Math.Ceiling(double.Parse(m_DataTable.Rows[i]["qty_dec"].ToString().Trim()));
                                dtTemp.Rows[indexHas]["tolprice_mny"] = Convert.ToDouble(dtTemp.Rows[indexHas]["tolprice_mny"].ToString().Trim()) + Convert.ToDouble(m_DataTable.Rows[i]["tolprice_mny"].ToString().Trim());
                            }
                            else
                            {
                                dr = dtTemp.NewRow();
                                for (int j = 0; j < dtTemp.Columns.Count; j++)
                                {
                                    dr[j] = m_DataTable.Rows[i][j];
                                }
                                dtTemp.Rows.Add(dr);
                            }
                        }
                    }
                    drarr = dtTemp.Select("qty_dec >-100", strOrder);
                    DataTable dtsource = dtTemp.Clone();
                    for (int i3 = 0; i3 < drarr.Length; i3++)
                    {
                        dr = dtsource.NewRow();
                        for (int j = 0; j < dtsource.Columns.Count; j++)
                        {
                            dr[j] = drarr[i3][j];
                        }
                        dtsource.Rows.Add(dr);
                    }
                    m_rptRpt.SetDataSource(dtsource);
                    m_rptRpt.Refresh();
                    crystalReportViewer1.ReportSource = m_rptRpt;
                }
                break;

            default:
                break;
            }
        }
Exemple #21
0
        private void cmbreports_SelectedIndexChanged(object sender, EventArgs e)
        {
            //try
            //{
            //    if (dgvCreditNote.CurrentRow != null)
            //    {
            //        RPT_Sub(Convert.ToInt64(dgvCreditNote.CurrentRow.Cells["CNID"].Value), dgvCreditNote.CurrentRow.Cells["CNnumber"].Value.ToString(), true);
            //    }
            //    else
            //    {
            //        MessageBox.Show(CommSelect.Exception.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //    }
            //}
            //catch (Exception exc)
            //{
            //    Utill.Common.ExceptionLogger.writeException("Quotation - Report", exc.StackTrace);
            //    MessageBox.Show(Utill.Common.CommonMessage.ExceptionMessage, "Exception");
            //}

            try
            {
                if (cmbreports.SelectedIndex == 1)
                {
                    DataTable dt = new DataTable();
                    LogoBind(dt);
                    if (dgvCreditNote.CurrentRow != null)
                    {
                        DataTable dtTNC = new DataTable();
                        //NameValueCollection para2 = new NameValueCollection();
                        //para2.Add("@i_Code", dgvSalesInvoice.CurrentRow.Cells["SalesCode"].Value.ToString());
                        //para2.Add("@i_TNC_Sub", "SALES");

                        //dtTNC = objDA.ExecuteDataTableSP("rpt_Sales_TNC", para2, false, ref mException, ref mErrorMsg, "Quotation TNC");

                        DataTable dtReport = new DataTable();

                        NameValueCollection para = new NameValueCollection();
                        para.Add("@i_RecID", Convert.ToInt64(dgvCreditNote.CurrentRow.Cells["CNID"].Value).ToString());
                        dtReport = objList.ListOfRecord("rpt_CreditNote", para, "CreditNote - Report");

                        //NameValueCollection para2 = new NameValueCollection();
                        //_CompId = CurrentCompany.CompId;
                        //para2.Add("@i_CompId", _CompId.ToString());
                        //dtCompany = objList.ListOfRecord("rpt_Company", para2, "Quotation - Report");
                        //dtReport.TableName = "CreditNote";
                        //dtReport.WriteXmlSchema(@"D:\CreditNote.xsd");

                        dtReport = objList.ListOfRecord("rpt_CreditNote", para, "CreditNote - Report");
                        if (objList.Exception == null)
                        {
                            if (System.IO.File.Exists(CurrentUser.ReportPath + "rptCreditNote.rpt"))
                            {
                                //dtReport.TableName = "PurchaseOrder";
                                //dtReport.WriteXmlSchema(@"D:\PurchaseOrder.xsd");
                                CrystalDecisions.CrystalReports.Engine.ReportDocument rptDoc = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
                                rptDoc.Load(CurrentUser.ReportPath + "rptCreditNote.rpt");
                                rptDoc.Subreports[0].DataSourceConnections.Clear();
                                //rptDoc.Subreports[0].Database.Tables[0].SetDataSource(dtTNC);
                                rptDoc.Database.Tables[1].SetDataSource(dt);
                                //rptDoc.Database.Tables[2].SetDataSource(dtCompany);

                                rptDoc.Refresh();
                                CurrentUser.AddReportParameters(rptDoc, dtReport, "", true, false, false, false, false, false, false, false, false, false, false);
                                CurrentUser.AddExtraParameter(rptDoc);
                                Reports.frmReportViewer fRptView = new Reports.frmReportViewer();
                                fRptView.Text = "Credit Note - [Page Size: A4]";
                                fRptView.crViewer.ReportSource = rptDoc;
                                fRptView.ShowDialog();
                            }
                            else
                            {
                                MessageBox.Show("Please check Company Details,\n Go to the Master->Edit->Company Details->ReportPath/DocPath.");
                            }
                        }
                        else
                        {
                            MessageBox.Show(objList.Exception.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                }
            }
            catch (Exception exc)
            {
                Utill.Common.ExceptionLogger.writeException("Sales Invoice", exc.StackTrace);
                MessageBox.Show(Utill.Common.CommonMessage.ExceptionMessage, "Exception");
            }
        }