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 classprotected classprotected classprotected classNested classes/interfaces inherited from class net.sf.jasperreports.engine.JRAbstractExporter
JRAbstractExporter.BaseExporterContext, JRAbstractExporter.PageRange -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected LinkedList<Color> static final StringThe exporter key, as used inGenericElementHandlerEnviroment.getElementHandler(JRGenericElementType, String).static final Stringprotected intprotected intstatic final StringProperty that provides the value for theclassCSS style property to be applied to elements in the table generated for the report.static final Stringprotected RenderersCachestatic final Stringprotected intprotected ExporterFilterprotected JRHyperlinkTargetProducerFactoryprotected WriterFields 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_PREFIXFields 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 ColorappendBackcolorStyle(TableCell cell, StringBuilder styleBuffer) protected booleanappendBorderStyle(JRLineBox box, StringBuilder styleBuffer) protected voidappendElementCellGenericStyle(TableCell cell, StringBuilder styleBuffer) protected booleanappendPadding(StringBuilder sb, Integer padding, String side) protected booleanappendPaddingStyle(JRLineBox box, StringBuilder styleBuffer) protected booleanappendPen(StringBuilder sb, JRPen pen, String side) protected voidappendSizeStyle(int width, int height, StringBuilder styleBuffer) protected voidendCell(TableCell.CellType cellType) protected voidendHeading(AccessibilityTagEnum headingTag) protected voidvoidexportElements(List<JRPrintElement> elements) protected voidexportPage(JRPrintPage page) protected voidexportParagraph(StyledTextWriteContext context, JRPrintText printText, AttributedCharacterIterator allParagraphs, int paragraphStart, String paragraphText, Integer firstLineIndent, boolean justifyLastLine, String tooltip, boolean hyperlinkStarted) voidPerforms the export.protected voidprotected voidexportStyledText(JRPrintText printText, JRStyledText styledText, String tooltip, boolean hyperlinkStarted) protected voidexportStyledTextRun(String textRunStyle, Map<AttributedCharacterIterator.Attribute, Object> attributes, String text, String tooltip, boolean hyperlinkStarted) protected voidexportTable(HtmlExporter.TableVisitor tableVisitor, Table table, boolean whiteBackground, boolean isMainReportTable) protected voidprotected StringgetCellProperty(JRPrintElement element, TableCell cell, String key) protected Class<HtmlExporterConfiguration> getDataAttributes(JRPrintElement element, TableCell cell) protected JRPrintElementIndexgetElementIndex(TableCell cell) Returns the properties prefix for the current exporter.protected Stringprotected Stringprotected Stringprotected Stringprotected Class<HtmlReportConfiguration> protected StringgetTextRunStyle(Map<AttributedCharacterIterator.Attribute, Object> attributes, Locale locale, LineSpacingEnum lineSpacing, Float lineSpacingSize, float lineSpacingFactor, Color backcolor, boolean hyperlinkStarted) protected voidprotected voidprotected booleanisOblique(JRPrintLine line) protected booleanmatchesBackcolor(Color backcolor) protected StringresolveHyperlinkURL(int reportIndex, JRPrintHyperlink link) protected voidprotected voidsetBackcolor(Color color) protected voidsetJasperReportsContext(JasperReportsContext jasperReportsContext) protected StringsetRotationStyles(JRPrintText text, String horizontalAlignment, StringBuilder spanStyleBuffer, StringBuilder divStyleBuffer) protected voidstartCell(int colSpan, int rowSpan, TableCell.CellType cellType) protected voidprotected voidstartCell(JRPrintElement element, TableCell cell) protected AccessibilityTagEnumstartHeading(JRPrintText text) protected booleantoSizeUnit(float size) protected floattoZoom(float size) protected voidwriteEllipse(JRPrintEllipse ellipse, TableCell cell) protected voidwriteEmptyCell(int colSpan, int rowSpan) protected voidwriteFrameCell(TableCell cell) protected voidwriteGenericElement(JRGenericPrintElement element, TableCell cell) voidwriteImage(JRPrintImage image, TableCell cell) protected voidwriteImageAreaCoordinates(int[] coords) protected voidwriteImageAreaHyperlink(JRPrintHyperlink hyperlink) protected voidwriteImageMap(String imageMapName, JRPrintImage image, List<JRPrintImageAreaHyperlink> imageMapAreas) protected voidwriteLayers(List<Table> layers, HtmlExporter.TableVisitor tableVisitor, TableCell cell) protected voidwriteLine(JRPrintLine line, TableCell cell) protected voidwriteNestedTable(Table table, HtmlExporter.TableVisitor tableVisitor, TableCell cell) protected voidwriteRectangle(JRPrintRectangle rectangle, TableCell cell) protected voidwriteStyle(StringBuilder styleBuffer) protected voidwriteSvgStyle(JRPrintGraphicElement element) protected voidwriteText(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, resolveFontFamilyMethods 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 theclassCSS 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 theclassattribute of the<td>tag for the element when exported to HTML and/or theclassattribute 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:JRAbstractExporterReturns the properties prefix for the current exporter.- Specified by:
getExporterPropertiesPrefixin classJRAbstractExporter<HtmlReportConfiguration,HtmlExporterConfiguration, HtmlExporterOutput, JRHtmlExporterContext> - Returns:
- the properties prefix for the current exporter
-
exportReport
Description copied from interface:ExporterPerforms the export.- Specified by:
exportReportin interfaceExporter<ExporterInput,HtmlReportConfiguration, HtmlExporterConfiguration, HtmlExporterOutput> - Specified by:
exportReportin classJRAbstractExporter<HtmlReportConfiguration,HtmlExporterConfiguration, HtmlExporterOutput, JRHtmlExporterContext> - Throws:
JRException
-
getConfigurationInterface
-
getItemConfigurationInterface
-
initExport
protected void initExport() -
initReport
protected void initReport() -
setJasperReportsContext
-
exportReportToWriter
- Throws:
JRExceptionIOException
-
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:
IOExceptionJRException
-
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:
IOExceptionJRException
-
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
-