Package com.haulmont.yarg.exception

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


            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

                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

        } 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

                        throw (NoFreePortsException) e;
                    }
                }
            }

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

            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

TOP

Related Classes of com.haulmont.yarg.exception.ReportingException

Copyright © 2018 www.massapicom. 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.