public class HtmlExporter extends AbstractHtmlExporter<HtmlReportConfiguration,HtmlExporterConfiguration>
Modifier and Type | Class and Description |
---|---|
protected class |
HtmlExporter.CellElementVisitor |
protected class |
HtmlExporter.ExporterContext |
protected class |
HtmlExporter.TableVisitor |
JRAbstractExporter.BaseExporterContext, JRAbstractExporter.PageRange
Modifier and Type | Field and Description |
---|---|
protected java.util.LinkedList<java.awt.Color> |
backcolorStack |
protected java.util.Map<java.lang.String,HtmlFont> |
fontsToProcess |
static java.lang.String |
HTML_EXPORTER_KEY
The exporter key, as used in
GenericElementHandlerEnviroment.getElementHandler(JRGenericElementType, String) . |
static java.lang.String |
HTML_EXPORTER_PROPERTIES_PREFIX |
protected java.util.Map<Pair<java.lang.String,java.awt.Rectangle>,java.lang.String> |
imageMaps |
protected int |
pageIndex |
protected int |
pointerEventsNoneStack |
static java.lang.String |
PROPERTY_BORDER_COLLAPSE
Deprecated.
Replaced by
HtmlReportConfiguration.PROPERTY_BORDER_COLLAPSE . |
static java.lang.String |
PROPERTY_HTML_CLASS
Property that provides the value for the
class CSS style property to be applied
to elements in the table generated for the report. |
static java.lang.String |
PROPERTY_HTML_ID |
static java.lang.String |
PROPERTY_IGNORE_HYPERLINK
Deprecated.
Replaced by
HtmlReportConfiguration.PROPERTY_IGNORE_HYPERLINK . |
protected java.util.Map<java.lang.String,java.lang.String> |
rendererToImagePathMap |
protected int |
reportIndex |
protected ExporterFilter |
tableFilter |
protected JRHyperlinkTargetProducerFactory |
targetProducerFactory |
protected java.io.Writer |
writer |
CSS_TEXT_ALIGN_CENTER, CSS_TEXT_ALIGN_JUSTIFY, CSS_TEXT_ALIGN_LEFT, CSS_TEXT_ALIGN_RIGHT, DEFAULT_ZOOM, fontHandler, HTML_VERTICAL_ALIGN_BOTTOM, HTML_VERTICAL_ALIGN_MIDDLE, HTML_VERTICAL_ALIGN_TOP, IMAGE_NAME_PREFIX, IMAGE_NAME_PREFIX_LEGTH, imageHandler, JR_BOOKMARK_ANCHOR_PREFIX, JR_PAGE_ANCHOR_PREFIX, resourceHandler
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 |
---|
HtmlExporter() |
HtmlExporter(JasperReportsContext jasperReportsContext) |
Modifier and Type | Method and Description |
---|---|
protected java.awt.Color |
appendBackcolorStyle(TableCell cell,
java.lang.StringBuilder styleBuffer) |
protected boolean |
appendBorderStyle(JRLineBox box,
java.lang.StringBuilder styleBuffer) |
protected void |
appendElementCellGenericStyle(TableCell cell,
java.lang.StringBuilder styleBuffer) |
protected boolean |
appendPadding(java.lang.StringBuilder sb,
java.lang.Integer padding,
java.lang.String side) |
protected boolean |
appendPaddingStyle(JRLineBox box,
java.lang.StringBuilder styleBuffer) |
protected boolean |
appendPen(java.lang.StringBuilder sb,
JRPen pen,
java.lang.String side) |
protected void |
appendSizeStyle(int width,
int height,
java.lang.StringBuilder styleBuffer) |
protected void |
endCell() |
protected void |
endHyperlink() |
protected void |
ensureOutput() |
void |
exportElements(java.util.List<JRPrintElement> elements) |
protected void |
exportPage(JRPrintPage page) |
void |
exportReport()
Performs the export.
|
protected void |
exportReportToWriter() |
protected void |
exportStyledText(JRPrintText printText,
JRStyledText styledText,
java.lang.String tooltip,
boolean hyperlinkStarted) |
protected void |
exportStyledTextRun(java.util.Map<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> attributes,
java.lang.String text,
java.lang.String tooltip,
java.util.Locale locale,
LineSpacingEnum lineSpacing,
java.lang.Float lineSpacingSize,
float lineSpacingFactor,
java.awt.Color backcolor,
boolean hyperlinkStarted) |
protected void |
exportTable(HtmlExporter.TableVisitor tableVisitor,
Table table,
boolean whiteBackground,
boolean isMainReportTable) |
protected void |
finishStartCell() |
protected java.lang.String |
getCellProperty(JRPrintElement element,
TableCell cell,
java.lang.String key) |
protected java.lang.Class<HtmlExporterConfiguration> |
getConfigurationInterface() |
java.lang.String |
getDataAttributes(JRPrintElement element,
TableCell cell) |
protected JRPrintElementIndex |
getElementIndex(TableCell cell) |
java.lang.String |
getExporterKey() |
java.lang.String |
getExporterPropertiesPrefix()
Returns the properties prefix for the current exporter.
|
protected java.lang.String |
getHyperlinkTarget(JRPrintHyperlink link) |
protected java.lang.String |
getHyperlinkURL(JRPrintHyperlink link) |
protected double[] |
getImageNormalSize(JRPrintImage image,
Renderable renderer,
int imageWidth,
int imageHeight) |
protected java.lang.Class<HtmlReportConfiguration> |
getItemConfigurationInterface() |
protected JRStyledText |
getStyledText(JRPrintText textElement,
boolean setBackcolor) |
protected void |
initExport() |
protected void |
initReport() |
protected boolean |
matchesBackcolor(java.awt.Color backcolor) |
protected java.lang.String |
resolveHyperlinkURL(int reportIndex,
JRPrintHyperlink link) |
protected void |
restoreBackcolor() |
protected void |
setBackcolor(java.awt.Color color) |
protected void |
setImageHorizontalAlignmentStyle(JRPrintImage image,
java.lang.StringBuilder styleBuffer) |
protected void |
setImageVerticalAlignmentStyle(JRPrintImage image,
java.lang.StringBuilder styleBuffer) |
protected void |
setJasperReportsContext(JasperReportsContext jasperReportsContext) |
protected java.lang.String |
setRotationStyles(JRPrintText text,
java.lang.String horizontalAlignment,
java.lang.StringBuilder spanStyleBuffer,
java.lang.StringBuilder divStyleBuffer) |
protected void |
startCell(int colSpan,
int rowSpan) |
protected void |
startCell(JRPrintElement element,
TableCell cell) |
protected void |
startCell(TableCell cell) |
protected boolean |
startHyperlink(JRPrintHyperlink link) |
java.lang.String |
toSizeUnit(float size) |
java.lang.String |
toSizeUnit(int size)
Deprecated.
Replaced by
toSizeUnit(float) . |
protected float |
toZoom(float size) |
protected int |
toZoom(int size)
Deprecated.
Replaced by
toZoom(float) . |
protected void |
writeEmptyCell(int colSpan,
int rowSpan) |
protected void |
writeFrameCell(TableCell cell) |
protected void |
writeGenericElement(JRGenericPrintElement element,
TableCell cell) |
protected void |
writeImage(JRPrintImage image,
TableCell cell) |
protected void |
writeImageAreaCoordinates(int[] coords) |
protected void |
writeImageAreaHyperlink(JRPrintHyperlink hyperlink) |
protected void |
writeImageMap(java.lang.String imageMapName,
JRPrintImage image,
java.util.List<JRPrintImageAreaHyperlink> imageMapAreas) |
protected void |
writeLayers(java.util.List<Table> layers,
HtmlExporter.TableVisitor tableVisitor,
TableCell cell) |
protected void |
writeLine(JRPrintLine line,
TableCell cell) |
protected void |
writeRectangle(JRPrintGraphicElement element,
TableCell cell) |
protected void |
writeStyle(java.lang.StringBuilder styleBuffer) |
protected void |
writeText(JRPrintText text,
TableCell cell) |
getFontHandler, getImage, getImage, getImageHandler, getImageName, getPrintElementIndex, getResourceHandler, setFontHandler, setImageHandler, setResourceHandler
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, setOffset, setOffset, setParameter, setParameters, setReportContext
public static final java.lang.String HTML_EXPORTER_KEY
GenericElementHandlerEnviroment.getElementHandler(JRGenericElementType, String)
.public static final java.lang.String HTML_EXPORTER_PROPERTIES_PREFIX
public static final java.lang.String PROPERTY_IGNORE_HYPERLINK
HtmlReportConfiguration.PROPERTY_IGNORE_HYPERLINK
.public static final java.lang.String PROPERTY_HTML_CLASS
class
CSS style property to be applied
to elements in the table generated for the report. The value of this property
will be used as the value for the class
attribute of the <td>
tag for the element when exported to HTML and/or
the class
attribute of the <span>
or <div>
tag for the element, when exported to XHTML/CSS.public static final java.lang.String PROPERTY_HTML_ID
public static final java.lang.String PROPERTY_BORDER_COLLAPSE
HtmlReportConfiguration.PROPERTY_BORDER_COLLAPSE
.protected JRHyperlinkTargetProducerFactory targetProducerFactory
protected java.util.Map<java.lang.String,java.lang.String> rendererToImagePathMap
protected java.util.Map<Pair<java.lang.String,java.awt.Rectangle>,java.lang.String> imageMaps
protected java.util.Map<java.lang.String,HtmlFont> fontsToProcess
protected java.io.Writer writer
protected int reportIndex
protected int pageIndex
protected java.util.LinkedList<java.awt.Color> backcolorStack
protected ExporterFilter tableFilter
protected int pointerEventsNoneStack
public HtmlExporter()
public HtmlExporter(JasperReportsContext jasperReportsContext)
public java.lang.String getExporterKey()
public java.lang.String getExporterPropertiesPrefix()
JRAbstractExporter
getExporterPropertiesPrefix
in class JRAbstractExporter<HtmlReportConfiguration,HtmlExporterConfiguration,HtmlExporterOutput,JRHtmlExporterContext>
public void exportReport() throws JRException
Exporter
exportReport
in interface Exporter<ExporterInput,HtmlReportConfiguration,HtmlExporterConfiguration,HtmlExporterOutput>
exportReport
in class JRAbstractExporter<HtmlReportConfiguration,HtmlExporterConfiguration,HtmlExporterOutput,JRHtmlExporterContext>
JRException
protected java.lang.Class<HtmlExporterConfiguration> getConfigurationInterface()
protected java.lang.Class<HtmlReportConfiguration> getItemConfigurationInterface()
protected void ensureOutput()
protected void initExport()
protected void initReport()
protected void setJasperReportsContext(JasperReportsContext jasperReportsContext)
protected void exportReportToWriter() throws JRException, java.io.IOException
JRException
java.io.IOException
protected void exportPage(JRPrintPage page) throws java.io.IOException
java.io.IOException
public void exportElements(java.util.List<JRPrintElement> elements) throws java.io.IOException
java.io.IOException
protected void exportTable(HtmlExporter.TableVisitor tableVisitor, Table table, boolean whiteBackground, boolean isMainReportTable) throws java.io.IOException
java.io.IOException
protected void writeText(JRPrintText text, TableCell cell) throws java.io.IOException
java.io.IOException
protected java.lang.String setRotationStyles(JRPrintText text, java.lang.String horizontalAlignment, java.lang.StringBuilder spanStyleBuffer, java.lang.StringBuilder divStyleBuffer)
protected void appendSizeStyle(int width, int height, java.lang.StringBuilder styleBuffer)
protected void writeImage(JRPrintImage image, TableCell cell) throws java.io.IOException, JRException
java.io.IOException
JRException
protected void setImageHorizontalAlignmentStyle(JRPrintImage image, java.lang.StringBuilder styleBuffer)
protected void setImageVerticalAlignmentStyle(JRPrintImage image, java.lang.StringBuilder styleBuffer)
protected double[] getImageNormalSize(JRPrintImage image, Renderable renderer, int imageWidth, int imageHeight) throws JRException
JRException
protected JRPrintElementIndex getElementIndex(TableCell cell)
protected void writeImageMap(java.lang.String imageMapName, JRPrintImage image, java.util.List<JRPrintImageAreaHyperlink> imageMapAreas) throws java.io.IOException
java.io.IOException
protected void writeImageAreaCoordinates(int[] coords) throws java.io.IOException
java.io.IOException
protected void writeImageAreaHyperlink(JRPrintHyperlink hyperlink) throws java.io.IOException
java.io.IOException
protected void writeRectangle(JRPrintGraphicElement element, TableCell cell) throws java.io.IOException
java.io.IOException
protected void writeLine(JRPrintLine line, TableCell cell) throws java.io.IOException
java.io.IOException
protected void writeGenericElement(JRGenericPrintElement element, TableCell cell) throws java.io.IOException
java.io.IOException
protected void writeLayers(java.util.List<Table> layers, HtmlExporter.TableVisitor tableVisitor, TableCell cell) throws java.io.IOException
java.io.IOException
protected void startCell(JRPrintElement element, TableCell cell) throws java.io.IOException
java.io.IOException
public java.lang.String getDataAttributes(JRPrintElement element, TableCell cell)
protected java.lang.String getCellProperty(JRPrintElement element, TableCell cell, java.lang.String key)
protected void startCell(TableCell cell) throws java.io.IOException
java.io.IOException
protected void startCell(int colSpan, int rowSpan) throws java.io.IOException
java.io.IOException
protected void finishStartCell() throws java.io.IOException
java.io.IOException
protected void endCell() throws java.io.IOException
java.io.IOException
protected void writeEmptyCell(int colSpan, int rowSpan) throws java.io.IOException
java.io.IOException
protected void writeFrameCell(TableCell cell) throws java.io.IOException
java.io.IOException
protected void writeStyle(java.lang.StringBuilder styleBuffer) throws java.io.IOException
java.io.IOException
protected void appendElementCellGenericStyle(TableCell cell, java.lang.StringBuilder styleBuffer)
protected void setBackcolor(java.awt.Color color)
protected void restoreBackcolor()
protected boolean matchesBackcolor(java.awt.Color backcolor)
protected java.awt.Color appendBackcolorStyle(TableCell cell, java.lang.StringBuilder styleBuffer)
protected boolean appendBorderStyle(JRLineBox box, java.lang.StringBuilder styleBuffer)
protected boolean appendPen(java.lang.StringBuilder sb, JRPen pen, java.lang.String side)
protected boolean appendPaddingStyle(JRLineBox box, java.lang.StringBuilder styleBuffer)
protected boolean appendPadding(java.lang.StringBuilder sb, java.lang.Integer padding, java.lang.String side)
protected boolean startHyperlink(JRPrintHyperlink link) throws java.io.IOException
java.io.IOException
protected void endHyperlink() throws java.io.IOException
java.io.IOException
protected java.lang.String getHyperlinkURL(JRPrintHyperlink link)
protected java.lang.String resolveHyperlinkURL(int reportIndex, JRPrintHyperlink link)
protected java.lang.String getHyperlinkTarget(JRPrintHyperlink link)
public java.lang.String toSizeUnit(float size)
public java.lang.String toSizeUnit(int size)
toSizeUnit(float)
.protected float toZoom(float size)
protected int toZoom(int size)
toZoom(float)
.protected JRStyledText getStyledText(JRPrintText textElement, boolean setBackcolor)
protected void exportStyledText(JRPrintText printText, JRStyledText styledText, java.lang.String tooltip, boolean hyperlinkStarted) throws java.io.IOException
java.io.IOException
protected void exportStyledTextRun(java.util.Map<java.text.AttributedCharacterIterator.Attribute,java.lang.Object> attributes, java.lang.String text, java.lang.String tooltip, java.util.Locale locale, LineSpacingEnum lineSpacing, java.lang.Float lineSpacingSize, float lineSpacingFactor, java.awt.Color backcolor, boolean hyperlinkStarted) throws java.io.IOException
java.io.IOException
© 2001-2014 TIBCO Software Inc. www.jaspersoft.com