Exemplo n.º 1
0
        /// <summary>
        /// Get file CSV ヘッダレベル出力
        /// </summary>
        /// <param name="listOrder"></param>
        /// <param name="isCheck">false:簡易;true:全て</param>
        /// <param name="error"></param>
        /// <returns></returns>
        public MemoryStream ExportCSVRH9086(DataTable listOrder, bool isCheck, ref string error)
        {
            DataSet        result           = new DataSet();
            MemoryStream   streamReportsCSV = new MemoryStream();
            ReportServices reportService    = new ReportServices();

            if (isCheck)
            {
                result = GetDataReports(listOrder, ConstantsStpReports.RH9086_header_all, "@ListOrderNo", ref error);
            }
            else
            {
                result = GetDataReports(listOrder, ConstantsStpReports.RH9086_header_part, "@ListOrderNo", ref error);
            }
            try
            {
                if (string.IsNullOrEmpty(error))
                {
                    if (result.Tables.Count <= 0)
                    {
                        error = "I0007";
                    }
                    else if (result.Tables[0].Rows.Count <= 0)
                    {
                        error = "I0007";
                    }
                    else
                    {
                        streamReportsCSV = OutPutCSV.ExportCSV(result.Tables[0], "");
                    }
                }
            }
            catch (Exception)
            {
                error = "E0002";
            }
            return(streamReportsCSV);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Export reports RH4040 to file PDF
        /// </summary>
        /// <param name="listBillingNo"></param>
        /// <param name="error"></param>
        /// <returns></returns>
        public MemoryStream ExportPDFRH4040(DataTable listBillingNo, ref string error)
        {
            DataSet        result        = new DataSet();
            MemoryStream   streamReports = new MemoryStream();
            ReportServices reportService = new ReportServices();

            result = GetDataReports(listBillingNo, ConstantsStpReports.RH4040, "@TableListBillingNo", ref error);
            try
            {
                if (string.IsNullOrEmpty(error))
                {
                    if (result.Tables.Count <= 0)
                    {
                        error = "I0007";
                    }
                    else if (result.Tables[0].Rows.Count > 0)
                    {
                        error = "W0040";
                    }
                    else if (result.Tables[1].Rows.Count <= 0)
                    {
                        error = "I0007";
                    }
                    else
                    {
                        result.Tables.RemoveAt(0);
                        streamReports = reportService.ExportPDF("RH4040", result, ref error);
                    }
                }
            }
            catch (Exception)
            {
                error = "E0002";
            }
            return(streamReports);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Get file report with type MemoryStream
        /// </summary>
        /// <param name="reportID"></param>
        /// <param name="param"></param>
        /// <param name="messErr"></param>
        /// <returns>MemoryStream</returns>
        private MemoryStream GetFileReports(string reportID, string[,] param, ref string messErr)
        {
            DataSet        result        = new DataSet();
            MemoryStream   streamReports = new MemoryStream();
            ReportServices reportService = new ReportServices();

            switch (reportID)
            {
                #region Estimation
            case "RS3010":
                result = GetDataReports(param, ConstantsStpReports.RS3010, ref messErr);
                break;

            case "RS3011":
                result = GetDataReports(param, ConstantsStpReports.RS3011, ref messErr);
                SetStreamImageInTable(result, 5);
                break;

            case "RS3012":
                result = GetDataReports(param, ConstantsStpReports.RS3012, ref messErr);
                break;

            case "RS3013":
                result = GetDataReports(param, ConstantsStpReports.RS3013, ref messErr);
                break;

            case "RS3014":
                result = GetDataReports(param, ConstantsStpReports.RS3014, ref messErr);
                break;

            case "RS3015":
                result = GetDataReports(param, ConstantsStpReports.RS3015, ref messErr);
                break;

            case "RS7010":
                result = GetDataReports(param, ConstantsStpReports.RS7010, ref messErr);
                break;
                #endregion

                #region Order
            case "RH2030":
                result = GetDataReports(param, ConstantsStpReports.RH2030, ref messErr);
                break;

            case "RH2031":
                result = GetDataReports(param, ConstantsStpReports.RH2031, ref messErr);
                break;

            case "RH2032":
                result = GetDataReports(param, ConstantsStpReports.RH2032, ref messErr);
                break;

            case "RH2033":
                result = GetDataReports(param, ConstantsStpReports.RH2033, ref messErr);
                break;

            case "RH2050":
                result = GetDataReports(param, ConstantsStpReports.RH2050, ref messErr);
                break;

            case "RH2060":
                result = GetDataReports(param, ConstantsStpReports.RH2060, ref messErr);
                break;

            case "RH2061":
                result = GetDataReports(param, ConstantsStpReports.RH2061, ref messErr);
                break;

            case "RH2070":
                result = GetDataReports(param, ConstantsStpReports.RH2070, ref messErr);
                break;

            case "RH2080":
                result = GetDataReports(param, ConstantsStpReports.RH2080, ref messErr);
                SetStreamImageInTable(result, 5);
                break;

            case "RH4040":
                result = GetDataReports(param, ConstantsStpReports.RH4040, ref messErr);
                break;

            case "RH5050":
                result = GetDataReports(param, ConstantsStpReports.RH5050, ref messErr);
                break;

            case "RH9040":
                result = GetDataReports(param, ConstantsStpReports.RH9040, ref messErr);
                break;
                #endregion
            }

            try
            {
                if (string.IsNullOrEmpty(messErr))
                {
                    if (result.Tables.Count <= 0)
                    {
                        messErr = "I0007";
                    }
                    else if (result.Tables[0].Rows.Count <= 0)
                    {
                        messErr = "I0007";
                    }
                    else
                    {
                        streamReports = reportService.ExportPDF(reportID, result, ref messErr);
                    }
                }
            }
            catch (Exception)
            {
                messErr = "E0002";
            }

            return(streamReports);
        }