public class JRRtfExporter extends JRAbstractExporter<RtfReportConfiguration,RtfExporterConfiguration,WriterExporterOutput,JRRtfExporterContext>
JRRtfExporter
implementation helps
to export JasperPrint documents in RTF format using RTF Specification 1.6. This
means that the RTF files produced by this exporter are compatible with Microsoft Word
6.0, 2003 and XP.
However, users might experience some problems when opening those RTF files with
OpenOffice or StarOffice, as these products are not perfectly compatible with the RTF
specifications from Microsoft.
RTF is a character-based file format that supports absolute positioning of elements,
which means that this exporter produces output very similar to that of the Graphics2D
and PDF exporters. The RtfReportConfiguration
provides special
configuration settings for this exporter.
Almost all the provided samples show how to export to RTF.RtfReportConfiguration
Modifier and Type | Class and Description |
---|---|
protected class |
JRRtfExporter.ExporterContext |
JRAbstractExporter.BaseExporterContext, JRAbstractExporter.PageRange
Modifier and Type | Field and Description |
---|---|
protected java.util.List<java.awt.Color> |
colors |
protected FileBufferedWriter |
colorWriter |
protected FileBufferedWriter |
contentWriter |
protected java.io.File |
destFile |
static java.lang.String |
EXCEPTION_MESSAGE_KEY_INVALID_TEXT_HEIGHT |
protected java.util.List<java.lang.String> |
fonts |
protected FileBufferedWriter |
fontWriter |
protected static java.lang.String |
JR_PAGE_ANCHOR_PREFIX |
static java.lang.String |
PROPERTY_IGNORE_HYPERLINK
Deprecated.
Replaced by
RtfReportConfiguration.PROPERTY_IGNORE_HYPERLINK . |
protected int |
reportIndex |
static java.lang.String |
RTF_EXPORTER_KEY
The exporter key, as used in
GenericElementHandlerEnviroment.getElementHandler(JRGenericElementType, String) . |
allSelector, crtCompositeConfiguration, crtCompositeItemConfiguration, crtItem, dateFormatCache, EXCEPTION_MESSAGE_KEY_END_PAGE_INDEX_OUT_OF_RANGE, EXCEPTION_MESSAGE_KEY_INVALID_IMAGE_NAME, EXCEPTION_MESSAGE_KEY_INVALID_ZOOM_RATIO, EXCEPTION_MESSAGE_KEY_MIXED_CALLS_NOT_ALLOWED, EXCEPTION_MESSAGE_KEY_OUTPUT_WRITER_ERROR, EXCEPTION_MESSAGE_KEY_PAGE_INDEX_OUT_OF_RANGE, EXCEPTION_MESSAGE_KEY_START_PAGE_INDEX_OUT_OF_RANGE, exporterConfiguration, exporterContext, exporterInput, exporterOutput, filter, itemConfiguration, jasperPrint, jasperReportsContext, noBackcolorSelector, noneSelector, numberFormatCache, parameters, propertiesUtil, PROPERTY_DEFAULT_FILTER_FACTORY, PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY, styledTextUtil, textValueClasses
Constructor and Description |
---|
JRRtfExporter() |
JRRtfExporter(JasperReportsContext jasperReportsContext) |
Modifier and Type | Method and Description |
---|---|
protected void |
endHyperlink(boolean startedHyperlink) |
protected void |
ensureOutput() |
protected void |
exportElements(java.util.Collection<JRPrintElement> elements) |
protected void |
exportEllipse(JRPrintEllipse ellipse)
Draw a ellipse object
|
void |
exportFrame(JRPrintFrame frame) |
protected void |
exportGenericElement(JRGenericPrintElement element) |
protected boolean |
exportHyperlink(JRPrintHyperlink link) |
void |
exportImage(JRPrintImage printImage)
Export a image object
|
protected void |
exportLine(JRPrintLine line)
Draw a line object
|
protected void |
exportPage(JRPrintPage page,
boolean lastPage)
Exports a report page
|
protected void |
exportRectangle(JRPrintRectangle rectangle)
Draw a rectangle
|
void |
exportReport()
Export report in .rtf format
|
protected void |
exportReportToWriter(java.io.Writer writer)
Export report in .rtf format to a stream
|
void |
exportText(JRPrintText text)
Draw a text box
|
protected java.lang.Class<RtfExporterConfiguration> |
getConfigurationInterface() |
java.lang.String |
getExporterKey() |
java.lang.String |
getExporterPropertiesPrefix()
Returns the properties prefix for the current exporter.
|
protected java.lang.Class<RtfReportConfiguration> |
getItemConfigurationInterface() |
protected void |
initExport() |
protected void |
initReport() |
protected void |
writeAnchor(java.lang.String anchorName) |
protected void |
writeShapeHyperlink(JRPrintHyperlink link) |
createFilter, defaultParseNumber, ensureInput, ensureJasperReportsContext, getBooleanCellValue, getCurrentConfiguration, getCurrentItemConfiguration, getCurrentJasperPrint, getCustomHandler, getDateCellValue, getDateFormat, getExporterContext, getExporterInput, getExporterOutput, getHyperlinkProducer, getJasperReportsContext, getLocale, getNumberCellValue, getNumberFormat, getOffsetX, getOffsetY, getPageRange, getParameter, getParameters, getPropertiesUtil, getReportContext, getStyledText, getStyledText, getTextFormatFactoryClass, getTextLocale, getTextTimeZone, getTextValue, getTextValueString, insideFrame, reset, resetClassLoader, resetExportContext, restoreElementOffsets, setClassLoader, setConfiguration, setConfiguration, setCurrentExporterInputItem, setExporterInput, setExporterOutput, setFrameElementsOffset, setJasperPrint, setJasperReportsContext, setOffset, setOffset, setParameter, setParameters, setReportContext
public static final java.lang.String EXCEPTION_MESSAGE_KEY_INVALID_TEXT_HEIGHT
public static final java.lang.String PROPERTY_IGNORE_HYPERLINK
RtfReportConfiguration.PROPERTY_IGNORE_HYPERLINK
.public static final java.lang.String RTF_EXPORTER_KEY
GenericElementHandlerEnviroment.getElementHandler(JRGenericElementType, String)
.protected static final java.lang.String JR_PAGE_ANCHOR_PREFIX
protected FileBufferedWriter colorWriter
protected FileBufferedWriter fontWriter
protected FileBufferedWriter contentWriter
protected java.io.File destFile
protected int reportIndex
protected java.util.List<java.awt.Color> colors
protected java.util.List<java.lang.String> fonts
public JRRtfExporter()
JRRtfExporter(JasperReportsContext)
public JRRtfExporter(JasperReportsContext jasperReportsContext)
protected java.lang.Class<RtfExporterConfiguration> getConfigurationInterface()
protected java.lang.Class<RtfReportConfiguration> getItemConfigurationInterface()
protected void ensureOutput()
ensureOutput
in class JRAbstractExporter<RtfReportConfiguration,RtfExporterConfiguration,WriterExporterOutput,JRRtfExporterContext>
public void exportReport() throws JRException
exportReport
in interface Exporter<ExporterInput,RtfReportConfiguration,RtfExporterConfiguration,WriterExporterOutput>
exportReport
in class JRAbstractExporter<RtfReportConfiguration,RtfExporterConfiguration,WriterExporterOutput,JRRtfExporterContext>
JRException
protected void initExport()
protected void initReport()
protected void exportReportToWriter(java.io.Writer writer) throws JRException, java.io.IOException
JRException
java.io.IOException
protected void exportPage(JRPrintPage page, boolean lastPage) throws JRException, java.io.IOException
page
- Page that will be exportedJRException
java.io.IOException
protected void exportLine(JRPrintLine line) throws java.io.IOException
line
- JasperReports line object - JRPrintLinejava.io.IOException
protected void exportRectangle(JRPrintRectangle rectangle) throws java.io.IOException
rectangle
- JasperReports rectangle object (JRPrintRectangle)java.io.IOException
protected void exportEllipse(JRPrintEllipse ellipse) throws java.io.IOException
ellipse
- JasperReports ellipse object (JRPrintElipse)java.io.IOException
public void exportText(JRPrintText text) throws java.io.IOException, JRException
text
- JasperReports text object (JRPrintText)JRException
java.io.IOException
public void exportImage(JRPrintImage printImage) throws JRException, java.io.IOException
printImage
- JasperReports image object (JRPrintImage)JRException
java.io.IOException
public void exportFrame(JRPrintFrame frame) throws JRException, java.io.IOException
frame
- JRException
java.io.IOException
protected void exportElements(java.util.Collection<JRPrintElement> elements) throws JRException, java.io.IOException
JRException
java.io.IOException
protected void exportGenericElement(JRGenericPrintElement element)
protected boolean exportHyperlink(JRPrintHyperlink link) throws java.io.IOException
java.io.IOException
protected void writeShapeHyperlink(JRPrintHyperlink link) throws java.io.IOException
java.io.IOException
protected void endHyperlink(boolean startedHyperlink) throws java.io.IOException
java.io.IOException
protected void writeAnchor(java.lang.String anchorName) throws java.io.IOException
java.io.IOException
public java.lang.String getExporterKey()
public java.lang.String getExporterPropertiesPrefix()
JRAbstractExporter
getExporterPropertiesPrefix
in class JRAbstractExporter<RtfReportConfiguration,RtfExporterConfiguration,WriterExporterOutput,JRRtfExporterContext>
© 2001-2014 TIBCO Software Inc. www.jaspersoft.com