|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jasperreports.engine.JRAbstractExporter net.sf.jasperreports.engine.export.JRTextExporter
public class JRTextExporter
Exports filled reports in plain text format. The text exporter allows users to define a custom character resolution (the number of columns and rows in text format). Since the character resolution is mapped on the actual pixel resolution, every character corresponds to a rectangle of pixels. If a certain text element has a smaller size in pixels (width, height, or both) than the number of pixels that map to a character, the text element will not be rendered. Because of this, users must take some precautions when creating reports for text export. First, they must make sure the page size in characters is large enough to render the report, because if the report pages contain too much text, some of it may be rendered only partially. On the other hand, if the character resolution is too small compared to the pixel resolution (say, a height of 20 characters for a page 800 pixels tall) all texts with sizes smaller than the one needed to map to a character, will not be displayed (in the previous example, a text element needs to be at least 800/20 = 40 pixels tall in order to be rendered).
As a conclusion, the text exporter will yield the better results if the space needed for displaying a text is large. So users have to either design reports with few text or export to big text pages. Another good practice is to arrange text elements at design time as similar as possible to a grid.
JRExporterParameter
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.sf.jasperreports.engine.JRAbstractExporter |
---|
JRAbstractExporter.BaseExporterContext, JRAbstractExporter.ParameterOverriddenResolver, JRAbstractExporter.ParameterOverrideResolver, JRAbstractExporter.ParameterResolver |
Field Summary | |
---|---|
protected java.lang.String |
betweenPagesText
|
protected float |
charHeight
|
protected float |
charWidth
|
protected java.lang.String |
lineSeparator
|
protected int |
pageHeightInChars
|
protected int |
pageWidthInChars
|
protected JRExportProgressMonitor |
progressMonitor
|
protected static java.lang.String |
systemLineSeparator
|
protected java.io.Writer |
writer
|
Fields inherited from class net.sf.jasperreports.engine.JRAbstractExporter |
---|
dateFormatCache, endPageIndex, filter, fontMap, globalOffsetX, globalOffsetY, hyperlinkProducerFactory, isModeBatch, jasperPrint, jasperPrintList, jasperReportsContext, numberFormatCache, parameters, PROPERTY_DEFAULT_FILTER_FACTORY, PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY, startPageIndex |
Constructor Summary | |
---|---|
JRTextExporter()
|
|
JRTextExporter(JasperReportsContext jasperReportsContext)
|
Method Summary | |
---|---|
protected void |
exportElements(java.util.List<JRPrintElement> elements)
|
protected void |
exportPage(JRPrintPage page)
Exports a page to the output writer. |
void |
exportReport()
Actually starts the export process. |
protected void |
exportReportToWriter()
|
protected void |
exportText(JRPrintText element)
Renders a text and places it in the output matrix. |
protected java.lang.String |
getExporterKey()
|
protected int |
getHeightInChars(int height)
Transforms height from pixel space to character space. |
protected JRStyledText |
getStyledText(JRPrintText textElement)
|
protected int |
getWidthInChars(int width)
Transforms width from pixel space to character space. |
void |
setReportParameters()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int pageWidthInChars
protected int pageHeightInChars
protected float charWidth
protected float charHeight
protected JRExportProgressMonitor progressMonitor
protected java.io.Writer writer
protected java.lang.String betweenPagesText
protected java.lang.String lineSeparator
protected static final java.lang.String systemLineSeparator
Constructor Detail |
---|
public JRTextExporter()
JRTextExporter(JasperReportsContext)
public JRTextExporter(JasperReportsContext jasperReportsContext)
Method Detail |
---|
public void exportReport() throws JRException
JRExporter
exportReport
in interface JRExporter
exportReport
in class JRAbstractExporter
JRException
public void setReportParameters() throws JRException
JRException
protected void exportReportToWriter() throws JRException, java.io.IOException
JRException
java.io.IOException
protected void exportPage(JRPrintPage page) throws java.io.IOException
java.io.IOException
protected 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)
getStyledText
in class JRAbstractExporter
protected java.lang.String getExporterKey()
getExporterKey
in class JRAbstractExporter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |