Examples of ReportingException


Examples of com.haulmont.yarg.exception.ReportingException

            StringWriter stringWriter = new StringWriter();
            new XMLWriter(stringWriter, OutputFormat.createPrettyPrint()).write(document);
            return stringWriter.toString();
        } catch (IOException e) {
            throw new ReportingException(e);
        }
    }
View Full Code Here

Examples of com.haulmont.yarg.exception.ReportingException

            if (reportTemplate.isCustom()) {
                try {
                    byte[] bytes = reportTemplate.getCustomReport().createReport(report, rootBand, params);
                    IOUtils.write(bytes, outputStream);
                } catch (IOException e) {
                    throw new ReportingException(String.format("An error occurred while processing custom template [%s].", reportTemplate.getDocumentName()), e);
                }
            } else {
                FormatterFactoryInput factoryInput = new FormatterFactoryInput(extension, rootBand, reportTemplate, outputStream);
                ReportFormatter formatter = formatterFactory.createFormatter(factoryInput);
                formatter.renderDocument();
View Full Code Here

Examples of com.haulmont.yarg.exception.ReportingException

                if (bandWithFileName != null) {
                    Object fileName = bandWithFileName.getData().get(paramName);

                    if (fileName == null) {
                        throw new ReportingException(String.format("No data in band [%s] parameter [%s] found.This band and parameter is used for output file name generation.", bandWithFileName, paramName));
                    } else {
                        outputName = fileName.toString();
                    }
                } else {
                    throw new ReportingException(String.format("No data in band [%s] found.This band is used for output file name generation.", bandName));
                }
            } else {
                outputName = outputNamePattern;
            }
        }
View Full Code Here

Examples of com.haulmont.yarg.exception.ReportingException

        } else if (Date.class.isAssignableFrom(parameterClass)) {
            try {
                Date date = DEFAULT_DATE_FORMAT.parse(paramValueStr);
                return date;
            } catch (java.text.ParseException e) {
                throw new ReportingException(
                        String.format("Couldn't read date from value [%s]. Date format should be [%s].",
                                paramValueStr,
                                DEFAULT_DATE_FORMAT_STR));
            }
        } else {
            try {
                Constructor constructor = ConstructorUtils.getAccessibleConstructor(parameterClass, String.class);
                if (constructor != null) {
                    Object value = constructor.newInstance(paramValueStr);
                    return value;
                } else {
                    Method valueOf = MethodUtils.getAccessibleMethod(parameterClass, "valueOf", String.class);
                    if (valueOf != null) {
                        Object value = valueOf.invoke(null, paramValueStr);
                        return value;
                    }
                }
            } catch (InstantiationException e) {
                throw new ReportingException(
                        String.format("Could not instantiate object with class [%s] from [%s] string.",
                                parameterClass.getCanonicalName(),
                                paramValueStr));
            } catch (IllegalAccessException e) {
                throw new ReportingException(
                        String.format("Could not instantiate object with class [%s] from [%s] string.",
                                parameterClass.getCanonicalName(),
                                paramValueStr));
            } catch (InvocationTargetException e) {
                throw new ReportingException(
                        String.format("Could not instantiate object with class [%s] from [%s] string.",
                                parameterClass.getCanonicalName(),
                                paramValueStr));
            }
        }
View Full Code Here

Examples of com.haulmont.yarg.exception.ReportingException

                        throw (NoFreePortsException) e;
                    }
                }
            }

            throw new ReportingException("An error occurred while converting xls to pdf.", e);
        }
    }
View Full Code Here

Examples of com.haulmont.yarg.exception.ReportingException

            public void processTaskInOpenOffice(OfficeResourceProvider ooResourceProvider) {
                try {
                    XComponent xComponent = ooResourceProvider.loadXComponent(documentBytes);
                    saveAndClose(ooResourceProvider, xComponent, outputStream, convertPattern);
                } catch (Exception e) {
                    throw new ReportingException("An error occurred while running task in Open Office server", e);
                }
            }
        };
        officeIntegration.runTaskWithTimeout(officeTask, officeIntegration.getTimeoutInSeconds());
    }
View Full Code Here

Examples of com.volantis.synergetics.reporting.ReportingException

                reportingConfig = parser.parse(is);
            } catch (RuntimeException re) {
                // this is a fatal error. Apps that rely on reporting cannot
                // continue if this occurs
                LOGGER.fatal("failed-to-parse-configuration-file", location, re);
                throw new ReportingException(
                    "failed-to-parse-configuration-file", location);
            }
        }

        FACTORY = new MetricGroupProxyFactory(reportingConfig);
View Full Code Here

Examples of org.wso2.carbon.reporting.api.ReportingException

                } else if (reportType.equals("html")) {
                    // used HtmlReport to generate HTML report
                    HtmlReport htmlReport = new HtmlReport();
                    outputStream = htmlReport.generateHtmlReport(jasperPrint);
                } else {
                    throw new ReportingException("requested report type " + reportType + " invalid");
                }
            } finally {
                if (outputStream != null) {
                    outputStream.close();
                }
            }
        } catch (IOException e) {
            throw new ReportingException(" Error occurred when closing report stream", e);
        }
        return outputStream;
    }
View Full Code Here

Examples of org.wso2.carbon.reporting.api.ReportingException

                } else if (reportType.equals("html")) {
                    // used HtmlReport to generate HTML report
                    HtmlReport htmlReport = new HtmlReport();
                    outputStream = htmlReport.generateHtmlReport(jasperPrint);
                } else {
                    throw new ReportingException("requested report type " + reportType + " invalid");
                }
            } finally {
                if (outputStream != null) {
                    outputStream.close();
                }
            }
        } catch (IOException e) {
            throw new ReportingException(" Error occurred when closing report stream", e);
        }catch (JRException e){
            throw new JRException("Failed to generate "+ reportType + " report" ,e);
        }
        if (outputStream == null) {
            throw new ReportingException("generated report byte stream null");
        }
        return outputStream.toByteArray();
    }
View Full Code Here

Examples of org.wso2.carbon.reporting.api.ReportingException

                if (log.isDebugEnabled()) {
                    log.info("no any report templates called " + templateName + " , to delete");
                }
            }
        } catch (RegistryException e) {
            throw new ReportingException("Error occurred deleting the report template : "+ templateName, e);
        }


    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.