Search in sources :

Example 1 with XMLProcessor

use of org.pentaho.reporting.engine.classic.core.modules.output.xml.XMLProcessor in project pentaho-platform by pentaho.

the class JFreeReportComponent method writeXml.

protected boolean writeXml(final MasterReport report, final OutputStream outputStream) {
    boolean result = false;
    try {
        final XMLProcessor processor = new XMLProcessor(report);
        final OutputStreamWriter writer = new OutputStreamWriter(outputStream);
        processor.setWriter(writer);
        processor.processReport();
        writer.close();
        result = true;
    } catch (ReportProcessingException e) {
        // $NON-NLS-1$
        error(Messages.getInstance().getString("JFreeReportXmlComponent.ERROR_0046_FAILED_TO_PROCESS_REPORT"), e);
    } catch (IOException e) {
        // $NON-NLS-1$
        error(Messages.getInstance().getString("JFreeReportXmlComponent.ERROR_0046_FAILED_TO_PROCESS_REPORT"), e);
    }
    return result;
}
Also used : XMLProcessor(org.pentaho.reporting.engine.classic.core.modules.output.xml.XMLProcessor) ReportProcessingException(org.pentaho.reporting.engine.classic.core.ReportProcessingException) OutputStreamWriter(java.io.OutputStreamWriter) ContentIOException(org.pentaho.reporting.libraries.repository.ContentIOException) IOException(java.io.IOException)

Example 2 with XMLProcessor

use of org.pentaho.reporting.engine.classic.core.modules.output.xml.XMLProcessor in project pentaho-platform by pentaho.

the class JFreeReportXmlComponent method performExport.

@SuppressWarnings("deprecation")
@Override
protected boolean performExport(final MasterReport report, final OutputStream outputStream) {
    try {
        final XMLProcessor processor = new XMLProcessor(report);
        final OutputStreamWriter writer = new OutputStreamWriter(outputStream);
        processor.setWriter(writer);
        processor.processReport();
        writer.close();
        close();
        return true;
    } catch (ReportProcessingException e) {
        // $NON-NLS-1$
        error(Messages.getInstance().getString("JFreeReportXmlComponent.ERROR_0046_FAILED_TO_PROCESS_REPORT"), e);
        return false;
    } catch (IOException e) {
        // $NON-NLS-1$
        error(Messages.getInstance().getString("JFreeReportXmlComponent.ERROR_0046_FAILED_TO_PROCESS_REPORT"), e);
        return false;
    }
}
Also used : XMLProcessor(org.pentaho.reporting.engine.classic.core.modules.output.xml.XMLProcessor) ReportProcessingException(org.pentaho.reporting.engine.classic.core.ReportProcessingException) OutputStreamWriter(java.io.OutputStreamWriter) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)2 OutputStreamWriter (java.io.OutputStreamWriter)2 ReportProcessingException (org.pentaho.reporting.engine.classic.core.ReportProcessingException)2 XMLProcessor (org.pentaho.reporting.engine.classic.core.modules.output.xml.XMLProcessor)2 ContentIOException (org.pentaho.reporting.libraries.repository.ContentIOException)1