Ejemplo n.º 1
0
        /// <summary>
        /// Export reports RH9040 to file PDF
        /// </summary>
        /// <param name="TableContactFubi"></param>
        /// <param name="error"></param>
        /// <returns></returns>
        public MemoryStream ExportPDFRH9040(DataTable TableContactFubi, ref string error)
        {
            DataSet        dataSetResult = new DataSet();
            MemoryStream   streamReports = new MemoryStream();
            ReportServices reportService = new ReportServices();

            try
            {
                if (string.IsNullOrEmpty(error))
                {
                    if (TableContactFubi.Rows.Count <= 0)
                    {
                        error = "I0007";
                    }
                    else
                    {
                        dataSetResult.Tables.Add(TableContactFubi);
                        streamReports = reportService.ExportPDF("RH9040", dataSetResult, ref error);
                    }
                }
            }
            catch (Exception)
            {
                error = "E0002";
            }
            return(streamReports);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Export reports RH5050 to file PDF
        /// </summary>
        /// <param name="TableKeyFind"></param>
        /// <param name="error"></param>
        /// <returns></returns>
        public MemoryStream ExportPDFRH5050(DataTable TableKeyFind, ref string error)
        {
            DataSet        result        = new DataSet();
            MemoryStream   streamReports = new MemoryStream();
            ReportServices reportService = new ReportServices();

            result = GetDataReports(TableKeyFind, ConstantsStpReports.RH5050, "@TableBilling", 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 if (result.Tables[1].Rows.Count <= 0)
                    {
                        error = "I0007";
                    }
                    else
                    {
                        streamReports = reportService.ExportPDF("RH5050", result, ref error);
                    }
                }
            }
            catch (Exception)
            {
                error = "E0002";
            }
            return(streamReports);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Export reports RH2051 to file PDF
        /// </summary>
        /// <param name="dtRH2051">DataSet: 2 table</param>
        /// <param name="error"></param>
        /// <returns></returns>
        public MemoryStream ExportPDFRH2051(DataSet dtRH2051, ref string error)
        {
            //DataSet result = new DataSet();
            MemoryStream   streamReports = new MemoryStream();
            ReportServices reportService = new ReportServices();

            try
            {
                if (dtRH2051.Tables.Count > 0)
                {
                    if (dtRH2051.Tables[0].Rows.Count > 0)
                    {
                        streamReports = reportService.ExportPDF("RH2051", dtRH2051, ref error);
                    }
                    else
                    {
                        error = "I0007";
                    }
                }
                else
                {
                    error = "I0007";
                }
            }
            catch (Exception)
            {
                error = "E0002";
            }

            return(streamReports);
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
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);
        }