Class HtmlExporter
- All Implemented Interfaces:
Exporter<ExporterInput,
HtmlReportConfiguration, HtmlExporterConfiguration, HtmlExporterOutput>
public class HtmlExporter
extends AbstractHtmlExporter<HtmlReportConfiguration,HtmlExporterConfiguration>
- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
protected class
protected class
protected class
Nested classes/interfaces inherited from class net.sf.jasperreports.engine.JRAbstractExporter
JRAbstractExporter.BaseExporterContext, JRAbstractExporter.PageRange
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected LinkedList
<Color> static final String
The exporter key, as used inGenericElementHandlerEnviroment.getElementHandler(JRGenericElementType, String)
.static final String
protected int
protected int
static final String
Property that provides the value for theclass
CSS style property to be applied to elements in the table generated for the report.static final String
protected RenderersCache
static final String
protected int
protected ExporterFilter
protected JRHyperlinkTargetProducerFactory
protected Writer
Fields inherited from class net.sf.jasperreports.engine.export.AbstractHtmlExporter
CSS_TEXT_ALIGN_CENTER, CSS_TEXT_ALIGN_JUSTIFY, CSS_TEXT_ALIGN_LEFT, CSS_TEXT_ALIGN_RIGHT, DEFAULT_ZOOM, fontsToProcess, HTML_VERTICAL_ALIGN_BOTTOM, HTML_VERTICAL_ALIGN_MIDDLE, HTML_VERTICAL_ALIGN_TOP, IMAGE_NAME_PREFIX, IMAGE_NAME_PREFIX_LEGTH, JR_BOOKMARK_ANCHOR_PREFIX, JR_PAGE_ANCHOR_PREFIX
Fields inherited from class net.sf.jasperreports.engine.JRAbstractExporter
allSelector, crtCompositeConfiguration, crtCompositeItemConfiguration, crtItem, dateFormatCache, EXCEPTION_MESSAGE_KEY_EMPTY_INPUT_SOURCE_IN_BATCH_MODE, EXCEPTION_MESSAGE_KEY_END_PAGE_INDEX_OUT_OF_RANGE, EXCEPTION_MESSAGE_KEY_INVALID_IMAGE_NAME, EXCEPTION_MESSAGE_KEY_INVALID_ZOOM_RATIO, EXCEPTION_MESSAGE_KEY_NO_INPUT_SOURCE, EXCEPTION_MESSAGE_KEY_NO_OUTPUT_SPECIFIED, 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, fontUtil, hyperlinkProducerFactory, itemConfiguration, jasperPrint, jasperReportsContext, noBackcolorSelector, noneSelector, numberFormatCache, propertiesUtil, PROPERTY_DEFAULT_FILTER_FACTORY, PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY, rendererUtil, styledTextUtil, textValueClasses
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Color
appendBackcolorStyle
(TableCell cell, StringBuilder styleBuffer) protected boolean
appendBorderStyle
(JRLineBox box, StringBuilder styleBuffer) protected void
appendElementCellGenericStyle
(TableCell cell, StringBuilder styleBuffer) protected boolean
appendPadding
(StringBuilder sb, Integer padding, String side) protected boolean
appendPaddingStyle
(JRLineBox box, StringBuilder styleBuffer) protected boolean
appendPen
(StringBuilder sb, JRPen pen, String side) protected void
appendSizeStyle
(int width, int height, StringBuilder styleBuffer) protected void
endCell
(TableCell.CellType cellType) protected void
endHeading
(AccessibilityTagEnum headingTag) protected void
void
exportElements
(List<JRPrintElement> elements) protected void
exportPage
(JRPrintPage page) protected void
exportParagraph
(StyledTextWriteContext context, JRPrintText printText, AttributedCharacterIterator allParagraphs, int paragraphStart, String paragraphText, Integer firstLineIndent, boolean justifyLastLine, String tooltip, boolean hyperlinkStarted) void
Performs the export.protected void
protected void
exportStyledText
(JRPrintText printText, JRStyledText styledText, String tooltip, boolean hyperlinkStarted) protected void
exportStyledTextRun
(String textRunStyle, Map<AttributedCharacterIterator.Attribute, Object> attributes, String text, String tooltip, boolean hyperlinkStarted) protected void
exportTable
(HtmlExporter.TableVisitor tableVisitor, Table table, boolean whiteBackground, boolean isMainReportTable) protected void
protected String
getCellProperty
(JRPrintElement element, TableCell cell, String key) protected Class
<HtmlExporterConfiguration> getDataAttributes
(JRPrintElement element, TableCell cell) protected JRPrintElementIndex
getElementIndex
(TableCell cell) Returns the properties prefix for the current exporter.protected String
protected String
protected String
protected String
protected Class
<HtmlReportConfiguration> protected String
getTextRunStyle
(Map<AttributedCharacterIterator.Attribute, Object> attributes, Locale locale, LineSpacingEnum lineSpacing, Float lineSpacingSize, float lineSpacingFactor, Color backcolor, boolean hyperlinkStarted) protected void
protected void
protected boolean
isOblique
(JRPrintLine line) protected boolean
matchesBackcolor
(Color backcolor) protected String
resolveHyperlinkURL
(int reportIndex, JRPrintHyperlink link) protected void
protected void
setBackcolor
(Color color) protected void
setJasperReportsContext
(JasperReportsContext jasperReportsContext) protected String
setRotationStyles
(JRPrintText text, String horizontalAlignment, StringBuilder spanStyleBuffer, StringBuilder divStyleBuffer) protected void
startCell
(int colSpan, int rowSpan, TableCell.CellType cellType) protected void
protected void
startCell
(JRPrintElement element, TableCell cell) protected AccessibilityTagEnum
startHeading
(JRPrintText text) protected boolean
toSizeUnit
(float size) protected float
toZoom
(float size) protected void
writeEllipse
(JRPrintEllipse ellipse, TableCell cell) protected void
writeEmptyCell
(int colSpan, int rowSpan) protected void
writeFrameCell
(TableCell cell) protected void
writeGenericElement
(JRGenericPrintElement element, TableCell cell) void
writeImage
(JRPrintImage image, TableCell cell) protected void
writeImageAreaCoordinates
(int[] coords) protected void
writeImageAreaHyperlink
(JRPrintHyperlink hyperlink) protected void
writeImageMap
(String imageMapName, JRPrintImage image, List<JRPrintImageAreaHyperlink> imageMapAreas) protected void
writeLayers
(List<Table> layers, HtmlExporter.TableVisitor tableVisitor, TableCell cell) protected void
writeLine
(JRPrintLine line, TableCell cell) protected void
writeNestedTable
(Table table, HtmlExporter.TableVisitor tableVisitor, TableCell cell) protected void
writeRectangle
(JRPrintRectangle rectangle, TableCell cell) protected void
writeStyle
(StringBuilder styleBuffer) protected void
writeSvgStyle
(JRPrintGraphicElement element) protected void
writeText
(JRPrintText text, TableCell cell) Methods inherited from class net.sf.jasperreports.engine.export.AbstractHtmlExporter
addFontFamily, getFontFamily, getImage, getImage, getImageName, getPrintElementIndex, getStyledText, handleFont, isConvertSvgToImage, isEmbeddedSvgUseFonts, isEmbedImage, isOverrideHints, isUseBackgroundImageToAlign, resolveFontFamily
Methods inherited from class net.sf.jasperreports.engine.JRAbstractExporter
checkInterrupted, createFilter, defaultParseNumber, ensureInput, ensureJasperReportsContext, ensureOutput, getBooleanCellValue, getCurrentConfiguration, getCurrentItemConfiguration, getCurrentJasperPrint, getDateCellValue, getDateFormat, getExporterConfiguration, getExporterContext, getExporterInput, getExporterOutput, getHyperlinkProducer, getJasperReportsContext, getLocale, getNumberCellValue, getNumberFormat, getOffsetX, getOffsetY, getPageRange, getPropertiesUtil, getRendererUtil, getReportContext, getReportExportConfiguration, getRepository, getStyledText, getTextFormatFactoryClass, getTextLocale, getTextTimeZone, getTextValue, getTextValueString, insideFrame, reset, resetExportContext, restoreElementOffsets, setConfiguration, setConfiguration, setCurrentExporterInputItem, setExporterInput, setExporterOutput, setFrameElementsOffset, setOffset, setOffset, setReportContext
-
Field Details
-
HTML_EXPORTER_KEY
The exporter key, as used inGenericElementHandlerEnviroment.getElementHandler(JRGenericElementType, String)
.- See Also:
-
HTML_EXPORTER_PROPERTIES_PREFIX
- See Also:
-
PROPERTY_HTML_CLASS
Property that provides the value for theclass
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 theclass
attribute of the<td>
tag for the element when exported to HTML and/or theclass
attribute of the<span>
or<div>
tag for the element, when exported to XHTML/CSS.- See Also:
-
PROPERTY_HTML_ID
- See Also:
-
REPORT_CONTEXT_PARAMETER_WEB_FONTS
- See Also:
-
targetProducerFactory
-
rendererToImagePathMap
-
imageMaps
-
renderersCache
-
writer
-
reportIndex
protected int reportIndex -
pageIndex
protected int pageIndex -
backcolorStack
-
tableFilter
-
pointerEventsNoneStack
protected int pointerEventsNoneStack
-
-
Constructor Details
-
HtmlExporter
public HtmlExporter() -
HtmlExporter
-
-
Method Details
-
getExporterKey
-
getExporterPropertiesPrefix
Description copied from class:JRAbstractExporter
Returns the properties prefix for the current exporter.- Specified by:
getExporterPropertiesPrefix
in classJRAbstractExporter<HtmlReportConfiguration,
HtmlExporterConfiguration, HtmlExporterOutput, JRHtmlExporterContext> - Returns:
- the properties prefix for the current exporter
-
exportReport
Description copied from interface:Exporter
Performs the export.- Specified by:
exportReport
in interfaceExporter<ExporterInput,
HtmlReportConfiguration, HtmlExporterConfiguration, HtmlExporterOutput> - Specified by:
exportReport
in classJRAbstractExporter<HtmlReportConfiguration,
HtmlExporterConfiguration, HtmlExporterOutput, JRHtmlExporterContext> - Throws:
JRException
-
getConfigurationInterface
-
getItemConfigurationInterface
-
initExport
protected void initExport() -
initReport
protected void initReport() -
setJasperReportsContext
-
exportReportToWriter
- Throws:
JRException
IOException
-
exportPage
- Throws:
IOException
-
exportElements
- Throws:
IOException
-
exportTable
protected void exportTable(HtmlExporter.TableVisitor tableVisitor, Table table, boolean whiteBackground, boolean isMainReportTable) throws IOException - Throws:
IOException
-
writeText
- Throws:
IOException
-
setRotationStyles
protected String setRotationStyles(JRPrintText text, String horizontalAlignment, StringBuilder spanStyleBuffer, StringBuilder divStyleBuffer) -
appendSizeStyle
-
writeImage
- Throws:
IOException
JRException
-
getImageHorizontalAlignmentStyle
-
getImageVerticalAlignmentStyle
-
getElementIndex
-
writeImageMap
protected void writeImageMap(String imageMapName, JRPrintImage image, List<JRPrintImageAreaHyperlink> imageMapAreas) throws IOException - Throws:
IOException
-
writeImageAreaCoordinates
- Throws:
IOException
-
writeImageAreaHyperlink
- Throws:
IOException
-
writeRectangle
- Throws:
IOException
-
writeEllipse
- Throws:
IOException
-
writeSvgStyle
- Throws:
IOException
-
writeLine
- Throws:
IOException
-
isOblique
-
writeGenericElement
protected void writeGenericElement(JRGenericPrintElement element, TableCell cell) throws IOException, JRException - Throws:
IOException
JRException
-
writeLayers
protected void writeLayers(List<Table> layers, HtmlExporter.TableVisitor tableVisitor, TableCell cell) throws IOException - Throws:
IOException
-
writeNestedTable
protected void writeNestedTable(Table table, HtmlExporter.TableVisitor tableVisitor, TableCell cell) throws IOException - Throws:
IOException
-
startCell
- Throws:
IOException
-
getDataAttributes
-
getCellProperty
-
startCell
- Throws:
IOException
-
startCell
- Throws:
IOException
-
finishStartCell
- Throws:
IOException
-
endCell
- Throws:
IOException
-
writeEmptyCell
- Throws:
IOException
-
writeFrameCell
- Throws:
IOException
-
writeStyle
- Throws:
IOException
-
appendElementCellGenericStyle
-
setBackcolor
-
restoreBackcolor
protected void restoreBackcolor() -
matchesBackcolor
-
appendBackcolorStyle
-
appendBorderStyle
-
appendPen
-
appendPaddingStyle
-
appendPadding
-
startHeading
- Throws:
IOException
-
endHeading
- Throws:
IOException
-
startHyperlink
- Throws:
IOException
-
endHyperlink
- Throws:
IOException
-
getHyperlinkURL
-
resolveHyperlinkURL
-
getHyperlinkTarget
-
toSizeUnit
-
toZoom
protected float toZoom(float size) -
exportStyledText
protected void exportStyledText(JRPrintText printText, JRStyledText styledText, String tooltip, boolean hyperlinkStarted) throws IOException - Throws:
IOException
-
exportParagraph
protected void exportParagraph(StyledTextWriteContext context, JRPrintText printText, AttributedCharacterIterator allParagraphs, int paragraphStart, String paragraphText, Integer firstLineIndent, boolean justifyLastLine, String tooltip, boolean hyperlinkStarted) throws IOException - Throws:
IOException
-
exportStyledTextRun
protected void exportStyledTextRun(String textRunStyle, Map<AttributedCharacterIterator.Attribute, Object> attributes, String text, String tooltip, boolean hyperlinkStarted) throws IOException- Throws:
IOException
-
getTextRunStyle
protected String getTextRunStyle(Map<AttributedCharacterIterator.Attribute, Object> attributes, Locale locale, LineSpacingEnum lineSpacing, Float lineSpacingSize, float lineSpacingFactor, Color backcolor, boolean hyperlinkStarted) throws IOException- Throws:
IOException
-