public class HtmlExporter extends AbstractHtmlExporter
| Modifier and Type | Class and Description |
|---|---|
protected class |
HtmlExporter.CellElementVisitor |
protected class |
HtmlExporter.ExporterContext |
protected class |
HtmlExporter.TableVisitor |
JRAbstractExporter.BaseExporterContext, JRAbstractExporter.ParameterOverriddenResolver, JRAbstractExporter.ParameterOverrideResolver, JRAbstractExporter.ParameterResolverfontHandler, imageHandler, resourceHandlerallSelector, dateFormatCache, endPageIndex, filter, fontMap, globalOffsetX, globalOffsetY, hyperlinkProducerFactory, isModeBatch, jasperPrint, jasperPrintList, jasperReportsContext, noBackcolorSelector, noneSelector, numberFormatCache, parameters, propertiesUtil, PROPERTY_DEFAULT_FILTER_FACTORY, PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY, startPageIndex, styledTextUtil| 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() |
void |
exportElements(List<JRPrintElement> elements) |
protected void |
exportPage(JRPrintPage page) |
void |
exportReport()
Actually starts the export process.
|
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) |
String |
getDataAttributes(JRPrintElement element,
TableCell cell) |
protected JRPrintElementIndex |
getElementIndex(TableCell cell) |
String |
getExporterKey() |
protected String |
getHyperlinkTarget(JRPrintHyperlink link) |
protected String |
getHyperlinkURL(JRPrintHyperlink link) |
static JRPrintImage |
getImage(List<JasperPrint> jasperPrintList,
JRPrintElementIndex imageIndex) |
static String |
getImageName(JRPrintElementIndex printElementIndex) |
protected double[] |
getImageNormalSize(JRPrintImage image,
Renderable renderer,
int imageWidth,
int imageHeight) |
protected JRStyledText |
getStyledText(JRPrintText textElement,
boolean setBackcolor) |
protected boolean |
matchesBackcolor(Color backcolor) |
protected static String |
resolveHyperlinkURL(JRAbstractExporter exporter,
int reportIndex,
JRPrintHyperlink link) |
protected void |
restoreBackcolor() |
protected void |
setBackcolor(Color color) |
protected void |
setImageHorizontalAlignmentStyle(JRPrintImage image,
StringBuilder styleBuffer) |
protected void |
setImageVerticalAlignmentStyle(JRPrintImage image,
StringBuilder styleBuffer) |
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(int size) |
protected int |
toZoom(int size) |
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(JRPrintGraphicElement element,
TableCell cell) |
protected void |
writeStyle(StringBuilder styleBuffer) |
protected void |
writeText(JRPrintText text,
TableCell cell) |
getFontHandler, getImageHandler, getResourceHandler, setFontHandler, setImageHandler, setResourceHandlercreateFilter, defaultParseNumber, getBooleanCellValue, getBooleanParameter, getCharacterParameter, getCurrentJasperPrint, getCustomHandler, getDateCellValue, getDateFormat, getFloatParameter, getHyperlinkProducer, getIntegerParameter, getJasperReportsContext, getLocale, getNumberCellValue, getNumberFormat, getOffsetX, getOffsetY, getParameter, getParameterResolver, getParameters, getPropertiesUtil, getReportContext, getStringArrayParameter, getStringParameter, getStringParameterOrDefault, getStyledText, getTextFormatFactoryClass, getTextLocale, getTextTimeZone, getTextValue, getTextValueString, reset, resetClassLoader, resetExportContext, restoreElementOffsets, setClassLoader, setExportContext, setFontMap, setFrameElementsOffset, setHyperlinkProducerFactory, setInput, setJasperPrint, setJasperReportsContext, setOffset, setOffset, setOutput, setPageRange, setParameter, setParameters, setReportContextpublic static final String HTML_EXPORTER_KEY
protected static final String HTML_EXPORTER_PROPERTIES_PREFIX
public static final String PROPERTY_IGNORE_HYPERLINK
public static final String PROPERTY_BORDER_COLLAPSE
border-collapse CSS property to be applied
to the table generated for the report.
The property can be set globally and at report level. It defaults to collapse.
protected static final float DEFAULT_ZOOM
public static final String IMAGE_NAME_PREFIX
protected static final String JR_PAGE_ANCHOR_PREFIX
protected JRHyperlinkTargetProducerFactory targetProducerFactory
protected JRExportProgressMonitor progressMonitor
protected String htmlHeader
protected String betweenPagesHtml
protected String htmlFooter
protected String encoding
protected String borderCollapse
protected boolean isWhitePageBackground
protected boolean isWrapBreakWord
protected boolean isIgnorePageMargins
protected boolean accessibleHtml
protected String sizeUnit
protected float zoom
protected boolean flushOutput
protected Writer writer
protected int reportIndex
protected int pageIndex
protected JRHtmlExporterContext exporterContext
protected LinkedList<Color> backcolorStack
protected ExporterFilter tableFilter
protected int pointerEventsNoneStack
public HtmlExporter()
public HtmlExporter(JasperReportsContext jasperReportsContext)
public static String getImageName(JRPrintElementIndex printElementIndex)
public static JRPrintImage getImage(List<JasperPrint> jasperPrintList, JRPrintElementIndex imageIndex)
public String getExporterKey()
getExporterKey in class JRAbstractExporterpublic void exportReport()
throws JRException
JRExporterexportReport in interface JRExporterexportReport in class JRAbstractExporterJRExceptionprotected void exportReportToWriter()
throws JRException,
IOException
JRExceptionIOExceptionprotected void exportPage(JRPrintPage page) throws IOException
IOExceptionpublic void exportElements(List<JRPrintElement> elements) throws IOException
IOExceptionprotected void exportTable(HtmlExporter.TableVisitor tableVisitor, Table table, boolean whiteBackground, boolean isMainReportTable) throws IOException
IOExceptionprotected void writeText(JRPrintText text, TableCell cell) throws IOException
IOExceptionprotected 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
IOExceptionJRExceptionprotected void setImageHorizontalAlignmentStyle(JRPrintImage image, StringBuilder styleBuffer)
protected void setImageVerticalAlignmentStyle(JRPrintImage image, StringBuilder styleBuffer)
protected double[] getImageNormalSize(JRPrintImage image, Renderable renderer, int imageWidth, int imageHeight) throws JRException
JRExceptionprotected JRPrintElementIndex getElementIndex(TableCell cell)
protected void writeImageMap(String imageMapName, JRPrintImage image, List<JRPrintImageAreaHyperlink> imageMapAreas) throws IOException
IOExceptionprotected void writeImageAreaCoordinates(int[] coords)
throws IOException
IOExceptionprotected void writeImageAreaHyperlink(JRPrintHyperlink hyperlink) throws IOException
IOExceptionprotected void writeRectangle(JRPrintGraphicElement element, TableCell cell) throws IOException
IOExceptionprotected void writeLine(JRPrintLine line, TableCell cell) throws IOException
IOExceptionprotected void writeGenericElement(JRGenericPrintElement element, TableCell cell) throws IOException
IOExceptionprotected void writeLayers(List<Table> layers, HtmlExporter.TableVisitor tableVisitor, TableCell cell) throws IOException
IOExceptionprotected void startCell(JRPrintElement element, TableCell cell) throws IOException
IOExceptionpublic String getDataAttributes(JRPrintElement element, TableCell cell)
protected String getCellProperty(JRPrintElement element, TableCell cell, String key)
protected void startCell(TableCell cell) throws IOException
IOExceptionprotected void startCell(int colSpan,
int rowSpan)
throws IOException
IOExceptionprotected void finishStartCell()
throws IOException
IOExceptionprotected void endCell()
throws IOException
IOExceptionprotected void writeEmptyCell(int colSpan,
int rowSpan)
throws IOException
IOExceptionprotected void writeFrameCell(TableCell cell) throws IOException
IOExceptionprotected void writeStyle(StringBuilder styleBuffer) throws IOException
IOExceptionprotected 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
IOExceptionprotected void endHyperlink()
throws IOException
IOExceptionprotected String getHyperlinkURL(JRPrintHyperlink link)
protected static String resolveHyperlinkURL(JRAbstractExporter exporter, int reportIndex, JRPrintHyperlink link)
protected String getHyperlinkTarget(JRPrintHyperlink link)
public String toSizeUnit(int size)
protected int toZoom(int size)
protected JRStyledText getStyledText(JRPrintText textElement, boolean setBackcolor)
getStyledText in class JRAbstractExporterprotected void exportStyledText(JRPrintText printText, JRStyledText styledText, String tooltip, boolean hyperlinkStarted) throws IOException
IOExceptionprotected 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
IOExceptionCopyright © 2014. All rights reserved.