|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.ui.jasperreports.JasperReportsUtils
public abstract class JasperReportsUtils
Utility methods for working with JasperReports. Provides a set of convenience methods for generating reports in a CSV, HTML, PDF and XLS formats.
Constructor Summary | |
---|---|
JasperReportsUtils()
|
Method Summary | |
---|---|
static net.sf.jasperreports.engine.JRDataSource |
convertReportData(Object value)
Convert the given report data value to a JRDataSource . |
static void |
render(net.sf.jasperreports.engine.JRAbstractExporter exporter,
net.sf.jasperreports.engine.JasperPrint print,
OutputStream outputStream)
Deprecated. in favor of the render version with JRExporter parameter |
static void |
render(net.sf.jasperreports.engine.JRAbstractExporter exporter,
net.sf.jasperreports.engine.JasperPrint print,
Writer writer)
Deprecated. in favor of the render version with JRExporter parameter |
static void |
render(net.sf.jasperreports.engine.JRExporter exporter,
net.sf.jasperreports.engine.JasperPrint print,
OutputStream outputStream)
Render the supplied JasperPrint instance using the
supplied JRAbstractExporter instance and write the results
to the supplied OutputStream . |
static void |
render(net.sf.jasperreports.engine.JRExporter exporter,
net.sf.jasperreports.engine.JasperPrint print,
Writer writer)
Render the supplied JasperPrint instance using the
supplied JRAbstractExporter instance and write the results
to the supplied Writer . |
static void |
renderAsCsv(net.sf.jasperreports.engine.JasperReport report,
Map parameters,
Object reportData,
Writer writer)
Render a report in CSV format using the supplied report data. |
static void |
renderAsHtml(net.sf.jasperreports.engine.JasperReport report,
Map parameters,
Object reportData,
Writer writer)
Render a report in HTML format using the supplied report data. |
static void |
renderAsPdf(net.sf.jasperreports.engine.JasperReport report,
Map parameters,
Object reportData,
OutputStream stream)
Render a report in PDF format using the supplied report data. |
static void |
renderAsXls(net.sf.jasperreports.engine.JasperReport report,
Map parameters,
Object reportData,
OutputStream stream)
Render a report in PDF format using the supplied report data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JasperReportsUtils()
Method Detail |
---|
public static net.sf.jasperreports.engine.JRDataSource convertReportData(Object value) throws IllegalArgumentException
JRDataSource
.
In the default implementation, a JRDataSource
,
java.util.Collection
or object array is detected.
The latter are converted to JRBeanCollectionDataSource
or JRBeanArrayDataSource
, respectively.
value
- the report data value to convert
IllegalArgumentException
- if the value could not be convertedJRDataSource
,
JRBeanCollectionDataSource
,
JRBeanArrayDataSource
public static void render(net.sf.jasperreports.engine.JRAbstractExporter exporter, net.sf.jasperreports.engine.JasperPrint print, Writer writer) throws net.sf.jasperreports.engine.JRException
render version with JRExporter parameter
net.sf.jasperreports.engine.JRException
render(net.sf.jasperreports.engine.JRExporter, net.sf.jasperreports.engine.JasperPrint, java.io.Writer)
public static void render(net.sf.jasperreports.engine.JRExporter exporter, net.sf.jasperreports.engine.JasperPrint print, Writer writer) throws net.sf.jasperreports.engine.JRException
JasperPrint
instance using the
supplied JRAbstractExporter
instance and write the results
to the supplied Writer
.
Make sure that the JRAbstractExporter
implementation
you supply is capable of writing to a Writer
.
exporter
- the JRAbstractExporter
to use to render the reportprint
- the JasperPrint
instance to renderwriter
- the Writer
to write the result to
net.sf.jasperreports.engine.JRException
- if rendering failedpublic static void render(net.sf.jasperreports.engine.JRAbstractExporter exporter, net.sf.jasperreports.engine.JasperPrint print, OutputStream outputStream) throws net.sf.jasperreports.engine.JRException
render version with JRExporter parameter
net.sf.jasperreports.engine.JRException
render(net.sf.jasperreports.engine.JRExporter, net.sf.jasperreports.engine.JasperPrint, java.io.OutputStream)
public static void render(net.sf.jasperreports.engine.JRExporter exporter, net.sf.jasperreports.engine.JasperPrint print, OutputStream outputStream) throws net.sf.jasperreports.engine.JRException
JasperPrint
instance using the
supplied JRAbstractExporter
instance and write the results
to the supplied OutputStream
.
Make sure that the JRAbstractExporter
implementation you
supply is capable of writing to a OutputStream
.
exporter
- the JRAbstractExporter
to use to render the reportprint
- the JasperPrint
instance to renderoutputStream
- the OutputStream
to write the result to
net.sf.jasperreports.engine.JRException
- if rendering failedpublic static void renderAsCsv(net.sf.jasperreports.engine.JasperReport report, Map parameters, Object reportData, Writer writer) throws net.sf.jasperreports.engine.JRException
Writer
.
report
- the JasperReport
instance to renderparameters
- the parameters to use for renderingwriter
- the Writer
to write the rendered report toreportData
- a JRDataSource
, java.util.Collection
or object array (converted accordingly), representing the report data to read
fields from
net.sf.jasperreports.engine.JRException
- if rendering failedconvertReportData(java.lang.Object)
public static void renderAsHtml(net.sf.jasperreports.engine.JasperReport report, Map parameters, Object reportData, Writer writer) throws net.sf.jasperreports.engine.JRException
Writer
.
report
- the JasperReport
instance to renderparameters
- the parameters to use for renderingwriter
- the Writer
to write the rendered report toreportData
- a JRDataSource
, java.util.Collection
or object array (converted accordingly), representing the report data to read
fields from
net.sf.jasperreports.engine.JRException
- if rendering failedconvertReportData(java.lang.Object)
public static void renderAsPdf(net.sf.jasperreports.engine.JasperReport report, Map parameters, Object reportData, OutputStream stream) throws net.sf.jasperreports.engine.JRException
OutputStream
.
report
- the JasperReport
instance to renderparameters
- the parameters to use for renderingstream
- the OutputStream
to write the rendered report toreportData
- a JRDataSource
, java.util.Collection
or object array (converted accordingly), representing the report data to read
fields from
net.sf.jasperreports.engine.JRException
- if rendering failedconvertReportData(java.lang.Object)
public static void renderAsXls(net.sf.jasperreports.engine.JasperReport report, Map parameters, Object reportData, OutputStream stream) throws net.sf.jasperreports.engine.JRException
OutputStream
.
report
- the JasperReport
instance to renderparameters
- the parameters to use for renderingstream
- the OutputStream
to write the rendered report toreportData
- a JRDataSource
, java.util.Collection
or object array (converted accordingly), representing the report data to read
fields from
net.sf.jasperreports.engine.JRException
- if rendering failedconvertReportData(java.lang.Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |