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
CSS_TEXT_ALIGN_CENTER, CSS_TEXT_ALIGN_JUSTIFY, CSS_TEXT_ALIGN_LEFT, CSS_TEXT_ALIGN_RIGHT, DEFAULT_ZOOM, fontHandler, fontsToProcess, 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, fontUtil, itemConfiguration, jasperPrint, jasperReportsContext, noBackcolorSelector, noneSelector, numberFormatCache, parameters, propertiesUtil, PROPERTY_DEFAULT_FILTER_FACTORY, PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY, rendererUtil, styledTextUtil, textValueClasses
Constructor and Description |
---|
HtmlExporter() |
HtmlExporter(JasperReportsContext jasperReportsContext) |
Modifier and Type | Method and Description |
---|---|
protected 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() |
protected void |
endHyperlink() |
protected void |
ensureOutput() |
void |
exportElements(List<JRPrintElement> elements) |
protected void |
exportPage(JRPrintPage page) |
void |
exportReport()
Performs the export.
|
protected void |
exportReportToWriter() |
protected void |
exportStyledText(JRPrintText printText,
JRStyledText styledText,
String tooltip,
boolean hyperlinkStarted) |
protected void |
exportStyledTextRun(Map<AttributedCharacterIterator.Attribute,Object> attributes,
String text,
String tooltip,
Locale locale,
LineSpacingEnum lineSpacing,
Float lineSpacingSize,
float lineSpacingFactor,
Color backcolor,
boolean hyperlinkStarted) |
protected void |
exportTable(HtmlExporter.TableVisitor tableVisitor,
Table table,
boolean whiteBackground,
boolean isMainReportTable) |
protected void |
finishStartCell() |
protected String |
getCellProperty(JRPrintElement element,
TableCell cell,
String key) |
protected Class<HtmlExporterConfiguration> |
getConfigurationInterface() |
String |
getDataAttributes(JRPrintElement element,
TableCell cell) |
protected JRPrintElementIndex |
getElementIndex(TableCell cell) |
String |
getExporterKey() |
String |
getExporterPropertiesPrefix()
Returns the properties prefix for the current exporter.
|
protected String |
getHyperlinkTarget(JRPrintHyperlink link) |
protected String |
getHyperlinkURL(JRPrintHyperlink link) |
protected String |
getImageHorizontalAlignmentStyle(JRPrintImage image) |
protected String |
getImageVerticalAlignmentStyle(JRPrintImage image) |
protected Class<HtmlReportConfiguration> |
getItemConfigurationInterface() |
protected void |
initExport() |
protected void |
initReport() |
protected boolean |
matchesBackcolor(Color backcolor) |
protected String |
resolveHyperlinkURL(int reportIndex,
JRPrintHyperlink link) |
protected void |
restoreBackcolor() |
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) |
protected void |
startCell(JRPrintElement element,
TableCell cell) |
protected void |
startCell(TableCell cell) |
protected boolean |
startHyperlink(JRPrintHyperlink link) |
String |
toSizeUnit(float size) |
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 |
writeEllipse(JRPrintEllipse ellipse,
TableCell cell) |
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(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 |
writeRectangle(JRPrintRectangle rectangle,
TableCell cell) |
protected void |
writeStyle(StringBuilder styleBuffer) |
protected void |
writeSvgStyle(JRPrintGraphicElement element) |
protected void |
writeText(JRPrintText text,
TableCell cell) |
addFontFamily, getFontFamily, getFontHandler, getImage, getImage, getImageHandler, getImageName, getImageName, getPrintElementIndex, getResourceHandler, getStyledText, handleFont, isEmbeddedSvgUseFonts, isEmbedImage, resolveFontFamily, 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, getRendererUtil, 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 String HTML_EXPORTER_KEY
GenericElementHandlerEnviroment.getElementHandler(JRGenericElementType, String)
.public static final String HTML_EXPORTER_PROPERTIES_PREFIX
public static final String PROPERTY_IGNORE_HYPERLINK
HtmlReportConfiguration.PROPERTY_IGNORE_HYPERLINK
.public static final 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 String PROPERTY_HTML_ID
public static final String PROPERTY_BORDER_COLLAPSE
HtmlReportConfiguration.PROPERTY_BORDER_COLLAPSE
.protected JRHyperlinkTargetProducerFactory targetProducerFactory
protected RenderersCache renderersCache
protected Writer writer
protected int reportIndex
protected int pageIndex
protected LinkedList<Color> backcolorStack
protected ExporterFilter tableFilter
protected int pointerEventsNoneStack
public HtmlExporter()
public HtmlExporter(JasperReportsContext jasperReportsContext)
public String getExporterKey()
public 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 Class<HtmlExporterConfiguration> getConfigurationInterface()
protected Class<HtmlReportConfiguration> getItemConfigurationInterface()
protected void ensureOutput()
protected void initExport()
protected void initReport()
protected void setJasperReportsContext(JasperReportsContext jasperReportsContext)
protected void exportReportToWriter() throws JRException, IOException
JRException
IOException
protected void exportPage(JRPrintPage page) throws IOException
IOException
public void exportElements(List<JRPrintElement> elements) throws IOException
IOException
protected void exportTable(HtmlExporter.TableVisitor tableVisitor, Table table, boolean whiteBackground, boolean isMainReportTable) throws IOException
IOException
protected void writeText(JRPrintText text, TableCell cell) throws IOException
IOException
protected String setRotationStyles(JRPrintText text, String horizontalAlignment, StringBuilder spanStyleBuffer, StringBuilder divStyleBuffer)
protected void appendSizeStyle(int width, int height, StringBuilder styleBuffer)
protected void writeImage(JRPrintImage image, TableCell cell) throws IOException, JRException
IOException
JRException
protected String getImageHorizontalAlignmentStyle(JRPrintImage image)
protected String getImageVerticalAlignmentStyle(JRPrintImage image)
protected JRPrintElementIndex getElementIndex(TableCell cell)
protected void writeImageMap(String imageMapName, JRPrintImage image, List<JRPrintImageAreaHyperlink> imageMapAreas) throws IOException
IOException
protected void writeImageAreaCoordinates(int[] coords) throws IOException
IOException
protected void writeImageAreaHyperlink(JRPrintHyperlink hyperlink) throws IOException
IOException
protected void writeRectangle(JRPrintRectangle rectangle, TableCell cell) throws IOException
IOException
protected void writeEllipse(JRPrintEllipse ellipse, TableCell cell) throws IOException
IOException
protected void writeSvgStyle(JRPrintGraphicElement element) throws IOException
IOException
protected void writeLine(JRPrintLine line, TableCell cell) throws IOException
IOException
protected void writeGenericElement(JRGenericPrintElement element, TableCell cell) throws IOException
IOException
protected void writeLayers(List<Table> layers, HtmlExporter.TableVisitor tableVisitor, TableCell cell) throws IOException
IOException
protected void startCell(JRPrintElement element, TableCell cell) throws IOException
IOException
public String getDataAttributes(JRPrintElement element, TableCell cell)
protected String getCellProperty(JRPrintElement element, TableCell cell, String key)
protected void startCell(TableCell cell) throws IOException
IOException
protected void startCell(int colSpan, int rowSpan) throws IOException
IOException
protected void finishStartCell() throws IOException
IOException
protected void endCell() throws IOException
IOException
protected void writeEmptyCell(int colSpan, int rowSpan) throws IOException
IOException
protected void writeFrameCell(TableCell cell) throws IOException
IOException
protected void writeStyle(StringBuilder styleBuffer) throws IOException
IOException
protected void appendElementCellGenericStyle(TableCell cell, StringBuilder styleBuffer)
protected void setBackcolor(Color color)
protected void restoreBackcolor()
protected boolean matchesBackcolor(Color backcolor)
protected Color appendBackcolorStyle(TableCell cell, StringBuilder styleBuffer)
protected boolean appendBorderStyle(JRLineBox box, StringBuilder styleBuffer)
protected boolean appendPen(StringBuilder sb, JRPen pen, String side)
protected boolean appendPaddingStyle(JRLineBox box, StringBuilder styleBuffer)
protected boolean appendPadding(StringBuilder sb, Integer padding, String side)
protected boolean startHyperlink(JRPrintHyperlink link) throws IOException
IOException
protected void endHyperlink() throws IOException
IOException
protected String getHyperlinkURL(JRPrintHyperlink link)
protected String resolveHyperlinkURL(int reportIndex, JRPrintHyperlink link)
protected String getHyperlinkTarget(JRPrintHyperlink link)
public String toSizeUnit(float size)
public String toSizeUnit(int size)
toSizeUnit(float)
.protected float toZoom(float size)
protected int toZoom(int size)
toZoom(float)
.protected void exportStyledText(JRPrintText printText, JRStyledText styledText, String tooltip, boolean hyperlinkStarted) throws IOException
IOException
protected void exportStyledTextRun(Map<AttributedCharacterIterator.Attribute,Object> attributes, String text, String tooltip, Locale locale, LineSpacingEnum lineSpacing, Float lineSpacingSize, float lineSpacingFactor, Color backcolor, boolean hyperlinkStarted) throws IOException
IOException
Copyright © 2016. All rights reserved.