com.jrefinery.report.targets.support
Class ReportProcessorUtil

java.lang.Object
  extended bycom.jrefinery.report.targets.support.ReportProcessorUtil

public class ReportProcessorUtil
extends java.lang.Object

Library functions to save a report into the different output targets. The functions here are provided to cover the common use cases, they are not intended to be configurable in any way.

Author:
Thomas Morgner

Constructor Summary
ReportProcessorUtil()
           
 
Method Summary
static void createCSV(JFreeReport report, java.lang.String filename)
          Saves a report to CSV format.
static void createDirectoryHTML(JFreeReport report, java.lang.String filename)
          Saves a report to HTML.
static boolean createPDF(JFreeReport report, java.lang.String fileName)
          Saves a report to PDF format.
static void createPlainText(JFreeReport report, java.lang.String filename)
          Saves a report to plain text format.
static void createRTF(JFreeReport report, java.lang.String filename)
          Saves a report to rich-text format (RTF).
static void createStreamHTML(JFreeReport report, java.lang.String filename)
          Saves a report into a single HTML format.
static void createXLS(JFreeReport report, java.lang.String filename)
          Saves a report to Excel format.
static void createZIPHTML(JFreeReport report, java.lang.String filename)
          Saves a report in a ZIP file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReportProcessorUtil

public ReportProcessorUtil()
Method Detail

createStreamHTML

public static void createStreamHTML(JFreeReport report,
                                    java.lang.String filename)
                             throws java.io.IOException,
                                    FunctionInitializeException,
                                    ReportProcessingException
Saves a report into a single HTML format.

Parameters:
report - the report.
filename - target file name.
Throws:
ReportProcessingException - if the report processing failed.
FunctionInitializeException - if the initialisation of the report processor failed.
java.io.IOException - if there was an IOerror while processing the report.

createPDF

public static boolean createPDF(JFreeReport report,
                                java.lang.String fileName)
Saves a report to PDF format.

Parameters:
report - the report.
fileName - target file name.
Returns:
true or false.

createPlainText

public static void createPlainText(JFreeReport report,
                                   java.lang.String filename)
                            throws java.io.IOException,
                                   ReportProcessingException,
                                   FunctionInitializeException,
                                   OutputTargetException
Saves a report to plain text format.

Parameters:
report - the report.
filename - target file name.
Throws:
ReportProcessingException - if the report processing failed.
FunctionInitializeException - if the initialisation of the report processor failed.
java.io.IOException - if there was an IOerror while processing the report.
OutputTargetException - if there is a problem with the output target.

createRTF

public static void createRTF(JFreeReport report,
                             java.lang.String filename)
                      throws java.io.IOException,
                             ReportProcessingException,
                             FunctionInitializeException
Saves a report to rich-text format (RTF).

Parameters:
report - the report.
filename - target file name.
Throws:
ReportProcessingException - if the report processing failed.
FunctionInitializeException - if the initialisation of the report processor failed.
java.io.IOException - if there was an IOerror while processing the report.

createCSV

public static void createCSV(JFreeReport report,
                             java.lang.String filename)
                      throws ReportProcessingException,
                             FunctionInitializeException,
                             java.io.IOException
Saves a report to CSV format.

Parameters:
report - the report.
filename - target file name.
Throws:
ReportProcessingException - if the report processing failed.
FunctionInitializeException - if the initialisation of the report processor failed.
java.io.IOException - if there was an IOerror while processing the report.

createXLS

public static void createXLS(JFreeReport report,
                             java.lang.String filename)
                      throws java.io.IOException,
                             FunctionInitializeException,
                             ReportProcessingException
Saves a report to Excel format.

Parameters:
report - the report.
filename - target file name.
Throws:
ReportProcessingException - if the report processing failed.
FunctionInitializeException - if the initialisation of the report processor failed.
java.io.IOException - if there was an IOerror while processing the report.

createDirectoryHTML

public static void createDirectoryHTML(JFreeReport report,
                                       java.lang.String filename)
                                throws java.io.IOException,
                                       ReportProcessingException,
                                       FunctionInitializeException
Saves a report to HTML. The HTML file is stored in a directory.

Parameters:
report - the report.
filename - target file name.
Throws:
ReportProcessingException - if the report processing failed.
FunctionInitializeException - if the initialisation of the report processor failed.
java.io.IOException - if there was an IOerror while processing the report.

createZIPHTML

public static void createZIPHTML(JFreeReport report,
                                 java.lang.String filename)
                          throws java.io.IOException,
                                 ReportProcessingException,
                                 FunctionInitializeException
Saves a report in a ZIP file. The zip file contains a HTML document.

Parameters:
report - the report.
filename - target file name.
Throws:
ReportProcessingException - if the report processing failed.
FunctionInitializeException - if the initialisation of the report processor failed.
java.io.IOException - if there was an IOerror while processing the report.