public class JRTextExporter extends JRAbstractExporter<TextReportConfiguration,TextExporterConfiguration,WriterExporterOutput,JRTextExporterContext>
TextReportConfiguration):
getCharWidth() and
getCharHeight() -
these specify how many pixels in the original report should be mapped onto a character in the exported text.getPageWidthInChars() and
getPageHeightInChars() -
these specify the text page width and height in characters.getPageSeparator()
exporter configuration setting. The default value is two blank lines.
The line separator to be used in the generated text file can be specified using the
getLineSeparator()
exporter configuration setting. This is most useful when you want to force a
particular line separator, knowing that the default line separator is operating system
dependent, as specified by the line.separator system property of the JVM.
Check the supplied /demo/samples/text sample to see the kind of output this exporter
can produce.TextExporterConfiguration,
TextReportConfiguration| Modifier and Type | Class and Description |
|---|---|
protected class |
JRTextExporter.ExporterContext |
JRAbstractExporter.BaseExporterContext, JRAbstractExporter.PageRange| Modifier and Type | Field and Description |
|---|---|
protected float |
charHeight |
protected float |
charWidth |
static java.lang.String |
EXCEPTION_MESSAGE_KEY_CHARACTER_HEIGHT_NEGATIVE |
static java.lang.String |
EXCEPTION_MESSAGE_KEY_CHARACTER_WIDTH_NEGATIVE |
static java.lang.String |
EXCEPTION_MESSAGE_KEY_REQUIRED_POSITIVE_PAGE_OR_CHARACTER_HEIGHT |
static java.lang.String |
EXCEPTION_MESSAGE_KEY_REQUIRED_POSITIVE_PAGE_OR_CHARACTER_WIDTH |
protected boolean |
isTrimLineRight |
protected java.lang.String |
lineSeparator |
protected int |
pageHeightInChars |
protected java.lang.String |
pageSeparator |
protected int |
pageWidthInChars |
protected static java.lang.String |
systemLineSeparator |
protected java.io.Writer |
writer |
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 |
|---|
JRTextExporter() |
JRTextExporter(JasperReportsContext jasperReportsContext) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
ensureOutput() |
protected void |
exportElements(java.util.List<JRPrintElement> elements) |
protected void |
exportPage(JRPrintPage page)
Exports a page to the output writer.
|
void |
exportReport()
Performs the export.
|
protected void |
exportReportToWriter() |
protected void |
exportText(JRPrintText element)
Renders a text and places it in the output matrix.
|
protected java.lang.Class<TextExporterConfiguration> |
getConfigurationInterface() |
java.lang.String |
getExporterKey() |
java.lang.String |
getExporterPropertiesPrefix()
Returns the properties prefix for the current exporter.
|
protected int |
getHeightInChars(int height)
Transforms height from pixel space to character space.
|
protected java.lang.Class<TextReportConfiguration> |
getItemConfigurationInterface() |
protected JRStyledText |
getStyledText(JRPrintText textElement) |
protected int |
getWidthInChars(int width)
Transforms width from pixel space to character space.
|
protected void |
initExport() |
protected void |
initReport() |
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, getTextFormatFactoryClass, getTextLocale, getTextTimeZone, getTextValue, getTextValueString, insideFrame, reset, resetClassLoader, resetExportContext, restoreElementOffsets, setClassLoader, setConfiguration, setConfiguration, setCurrentExporterInputItem, setExporterInput, setExporterOutput, setFrameElementsOffset, setJasperPrint, setJasperReportsContext, setOffset, setOffset, setParameter, setParameters, setReportContextpublic static final java.lang.String EXCEPTION_MESSAGE_KEY_REQUIRED_POSITIVE_PAGE_OR_CHARACTER_WIDTH
public static final java.lang.String EXCEPTION_MESSAGE_KEY_CHARACTER_WIDTH_NEGATIVE
public static final java.lang.String EXCEPTION_MESSAGE_KEY_REQUIRED_POSITIVE_PAGE_OR_CHARACTER_HEIGHT
public static final java.lang.String EXCEPTION_MESSAGE_KEY_CHARACTER_HEIGHT_NEGATIVE
protected java.io.Writer writer
protected int pageWidthInChars
protected int pageHeightInChars
protected float charWidth
protected float charHeight
protected java.lang.String pageSeparator
protected java.lang.String lineSeparator
protected boolean isTrimLineRight
protected static final java.lang.String systemLineSeparator
public JRTextExporter()
JRTextExporter(JasperReportsContext)public JRTextExporter(JasperReportsContext jasperReportsContext)
protected java.lang.Class<TextExporterConfiguration> getConfigurationInterface()
protected java.lang.Class<TextReportConfiguration> getItemConfigurationInterface()
protected void ensureOutput()
public void exportReport()
throws JRException
ExporterexportReport in interface Exporter<ExporterInput,TextReportConfiguration,TextExporterConfiguration,WriterExporterOutput>exportReport in class JRAbstractExporter<TextReportConfiguration,TextExporterConfiguration,WriterExporterOutput,JRTextExporterContext>JRExceptionprotected void initExport()
protected void initReport()
protected void exportReportToWriter()
throws JRException,
java.io.IOException
JRExceptionjava.io.IOExceptionprotected void exportPage(JRPrintPage page) throws java.io.IOException
java.io.IOExceptionprotected void exportElements(java.util.List<JRPrintElement> elements)
protected void exportText(JRPrintText element)
protected int getHeightInChars(int height)
protected int getWidthInChars(int width)
protected JRStyledText getStyledText(JRPrintText textElement)
public java.lang.String getExporterKey()
public java.lang.String getExporterPropertiesPrefix()
JRAbstractExportergetExporterPropertiesPrefix in class JRAbstractExporter<TextReportConfiguration,TextExporterConfiguration,WriterExporterOutput,JRTextExporterContext>© 2001-2014 TIBCO Software Inc. www.jaspersoft.com