Examples of ReportingException


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

                if (log.isDebugEnabled()) {
                    log.info("no any report templates available to generate reports");
                }
            }
        } catch (RegistryException e) {
            throw new ReportingException("Error occurred getting all the reports names", e);
        }
        return reportNames;

     }
View Full Code Here

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

     */
    public ByteArrayOutputStream generateExcelReport(JasperPrint jasperPrint) throws ReportingException, JRException {
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();

        if (jasperPrint == null) {
            throw new ReportingException("jasperPrint null, can't convert to excel report");
        }
        try {
            // Remove the pageHeader from pages except starting page
            jasperPrint.setProperty("net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.1", "pageHeader");
            //  Remove the pageFooter from all the pages
View Full Code Here

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

        OMElement reportJrXmlOmElement;
        try {
            resource = registry.get(jrXmlPath);
            reportDefinitionOmStream = resource.getContentStream();
        } catch (RegistryException e) {
            throw new ReportingException(reportTemplate + " getting  failed from " + componentName, e);
        }
        XMLInputFactory xmlInputFactory;
        XMLStreamReader xmlStreamReader = null;
        xmlInputFactory = XMLInputFactory.newInstance();
        try {
            xmlStreamReader = xmlInputFactory.createXMLStreamReader(reportDefinitionOmStream);
            stAXOMBuilder = new StAXOMBuilder(xmlStreamReader);
            reportJrXmlOmElement = stAXOMBuilder.getDocumentElement();
            return reportJrXmlOmElement.toString();
        } catch (XMLStreamException e) {
            throw new ReportingException(reportTemplate + " getting  failed from " + componentName, e);
        } finally {
            if (xmlStreamReader != null) {
                xmlStreamReader.close();
            }
        }
View Full Code Here

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

            Resource reportFilesResource = registry.newResource();
            reportFilesResource.setContent(fileContent);
            registry.put(REPORTS_PATH+fileName +".jrxml" ,reportFilesResource);
            status = true;
        } catch (RegistryException e) {
            throw new ReportingException("Failed to update report template "+ fileName ,e);
        }
        return status;
    }
View Full Code Here

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

            //create the builder
            StAXOMBuilder builder = new StAXOMBuilder(parser);
            //get the root element (in this case the envelope)
             documentElement = builder.getDocumentElement();
        } catch (XMLStreamException e) {
           throw new ReportingException("can not create OMElement from  " +xmlFile);
        }
        return documentElement;

    }
View Full Code Here

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

                dataSource = repositoryManager.getDataSource(dataSourceName);
                if (dataSource != null) {
                    try {
                        connection = dataSource.getConnection();
                    } catch (SQLException e) {
                        throw new ReportingException("Failed to get data source connection for "
                                                     + "\"" + dataSourceName + "\"", e);
                    }
                }
            }
        }
View Full Code Here

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

        JRXmlDataSource jrXmlDataSource;
        try {
            InputStream inputStream = new FileInputStream(new File(filePath));
            jrXmlDataSource = new JRXmlDataSource(inputStream);
        } catch (FileNotFoundException e) {
           throw new ReportingException(filePath +" file could not found");
        } catch (JRException e) {
           throw new ReportingException("could not create JRXmlDataSource from "+ filePath);
        }

        return jrXmlDataSource;
    }
View Full Code Here

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

       byte[] bytes = xmlAsString.getBytes();
        JRXmlDataSource jrXmlDataSourceFromString;
        try {
            jrXmlDataSourceFromString = new JRXmlDataSource(new ByteArrayInputStream(bytes));
        } catch (JRException e) {
            throw new ReportingException("could not create JRXmlDataSource from "+xmlAsString);
        }

        return jrXmlDataSourceFromString;
    }
View Full Code Here

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

            // generate JasperPrint Object from given JasperReport file and JRDataSource
            // by JasperFillManager
            try {
                map = getParamMap(reportParamMap, template);
            } catch (ReportingException e) {
                throw new ReportingException("Failed to get report param map", e);
            }
            if (dataSource instanceof JRDataSource) {
                jasperPrint = JasperFillManager.fillReport(jasperReport,map ,
                                                           (JRDataSource) dataSource);
View Full Code Here

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

                    String name = paramOmElement.getAttribute(new QName("name")).getAttributeValue();
                    reportParams.put(name, classValue);

                }
            } catch (ReportingException e) {
                throw new ReportingException("Failed to generate OmElement from template ", e);
            }

            for (ReportParamMap paramMap : reportParamMap) {
                String key = paramMap.getParamKey();
                String value = paramMap.getParamValue();
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.