Package org.mapfish.print.output
Class AbstractJasperReportOutputFormat
java.lang.Object
org.mapfish.print.output.AbstractJasperReportOutputFormat
- All Implemented Interfaces:
OutputFormat
- Direct Known Subclasses:
JasperReportExcelOutputFormat
,JasperReportImageOutputFormat
,JasperReportPDFOutputFormat
,JasperReportSvgOutputFormat
The AbstractJasperReportOutputFormat class.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
The print information for doing the export. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
doExport
(OutputStream outputStream, AbstractJasperReportOutputFormat.Print print) Export the report to the output stream.getJasperPrint
(Map<String, String> mdcContext, PJsonObject requestData, Configuration config, File configDir, File taskDirectory) Renders the jasper report.print
(Map<String, String> mdcContext, PJsonObject requestData, Configuration config, File configDir, File taskDirectory, OutputStream outputStream) Performs the print and writes to the report in the correct format to the outputStream.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.mapfish.print.output.OutputFormat
getContentType, getFileSuffix
-
Constructor Details
-
AbstractJasperReportOutputFormat
public AbstractJasperReportOutputFormat()
-
-
Method Details
-
doExport
protected abstract void doExport(OutputStream outputStream, AbstractJasperReportOutputFormat.Print print) throws net.sf.jasperreports.engine.JRException, IOException Export the report to the output stream.- Parameters:
outputStream
- the output stream to export toprint
- the report- Throws:
net.sf.jasperreports.engine.JRException
IOException
-
print
public final Processor.ExecutionContext print(@Nonnull Map<String, String> mdcContext, PJsonObject requestData, Configuration config, File configDir, File taskDirectory, OutputStream outputStream) throws ExceptionDescription copied from interface:OutputFormat
Performs the print and writes to the report in the correct format to the outputStream.- Specified by:
print
in interfaceOutputFormat
- Parameters:
mdcContext
- the MDC context for the current print job.requestData
- the data from the client, required for writing.config
- the configuration object representing the server side configuration.configDir
- the directory that contains the configuration, used for resolving resources like images etc...taskDirectory
- the temporary directory for this printing task.outputStream
- the stream to write the result to- Throws:
Exception
-
getJasperPrint
public final AbstractJasperReportOutputFormat.Print getJasperPrint(@Nonnull Map<String, String> mdcContext, PJsonObject requestData, Configuration config, File configDir, File taskDirectory) throws net.sf.jasperreports.engine.JRException, SQLException, ExecutionExceptionRenders the jasper report.- Parameters:
mdcContext
- the MDC context for the current print job.requestData
- the data from the client, required for writing.config
- the configuration object representing the server side configuration.configDir
- the directory that contains the configuration, used for resolving resources like images etc...taskDirectory
- the temporary directory for this printing task.- Returns:
- a jasper print object which can be used to generate a PDF or other outputs.
- Throws:
ExecutionException
net.sf.jasperreports.engine.JRException
SQLException
-