net.sf.jasperreports.engine.export
Class JRHtmlExporter
java.lang.Object
net.sf.jasperreports.engine.JRAbstractExporter
net.sf.jasperreports.engine.export.JRHtmlExporter
- All Implemented Interfaces:
- JRExporter
public class JRHtmlExporter
- extends JRAbstractExporter
Exports a JasperReports document to HTML format. It has character output type and exports the document to a
grid-based layout.
- Version:
- $Id: JRHtmlExporter.java 5180 2012-03-29 13:23:12Z teodord $
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
| Fields inherited from class net.sf.jasperreports.engine.JRAbstractExporter |
dateFormatCache, endPageIndex, filter, fontMap, globalOffsetX, globalOffsetY, hyperlinkProducerFactory, isModeBatch, jasperPrint, jasperPrintList, jasperReportsContext, numberFormatCache, parameters, PROPERTY_DEFAULT_FILTER_FACTORY, PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY, startPageIndex |
|
Method Summary |
protected Color |
appendBackcolorStyle(JRExporterGridCell gridCell,
StringBuffer styleBuffer)
|
protected boolean |
appendBorderStyle(JRLineBox box,
StringBuffer styleBuffer)
|
protected boolean |
appendPaddingStyle(JRLineBox box,
StringBuffer styleBuffer)
|
protected void |
endHyperlink()
|
protected void |
exportFrame(JRPrintFrame frame,
JRExporterGridCell gridCell)
|
protected void |
exportGenericElement(JRGenericPrintElement element,
JRExporterGridCell gridCell,
int rowHeight)
|
protected void |
exportGrid(JRGridLayout gridLayout,
boolean whitePageBackground)
|
protected void |
exportImage(JRPrintImage image,
JRExporterGridCell gridCell)
|
protected void |
exportLine(JRPrintLine line,
JRExporterGridCell gridCell)
|
protected void |
exportPage(JRPrintPage page)
|
protected void |
exportRectangle(JRPrintGraphicElement element,
JRExporterGridCell gridCell)
|
void |
exportReport()
Actually starts the export process. |
protected void |
exportReportToWriter()
|
protected void |
exportStyledText(JRStyledText styledText,
Locale locale)
|
protected void |
exportStyledText(JRStyledText styledText,
String tooltip,
Locale locale)
|
protected void |
exportStyledTextRun(Map<AttributedCharacterIterator.Attribute,Object> attributes,
String text,
Locale locale)
|
protected void |
exportStyledTextRun(Map<AttributedCharacterIterator.Attribute,Object> attributes,
String text,
String tooltip,
Locale locale)
|
protected void |
exportText(JRPrintText text,
JRExporterGridCell gridCell)
|
protected String |
getCellTag(JRExporterGridCell gridCell)
|
protected JRPrintElementIndex |
getElementIndex(JRExporterGridCell gridCell)
|
JasperPrint |
getExportedReport()
|
protected String |
getExporterKey()
|
Map<JRExporterParameter,Object> |
getExportParameters()
|
String |
getExportPropertiesPrefix()
|
protected String |
getHyperlinkTarget(JRPrintHyperlink link)
|
protected String |
getHyperlinkURL(JRPrintHyperlink link)
|
static JRPrintImage |
getImage(List<JasperPrint> jasperPrintList,
JRPrintElementIndex imageIndex)
|
static JRPrintImage |
getImage(List<JasperPrint> jasperPrintList,
String imageName)
|
static String |
getImageName(JRPrintElementIndex printElementIndex)
|
static JRPrintElementIndex |
getPrintElementIndex(String imageName)
|
protected JRStyledText |
getStyledText(JRPrintText textElement,
boolean setBackcolor)
|
protected void |
loadPxImage()
|
protected void |
restoreBackcolor()
|
protected void |
setBackcolor(Color color)
|
protected boolean |
startHyperlink(JRPrintHyperlink link)
|
String |
toSizeUnit(int size)
|
int |
toZoom(int size)
|
protected void |
writeCellEnd(JRExporterGridCell gridCell)
|
protected void |
writeCellStart(JRExporterGridCell gridCell)
|
protected void |
writeEmptyCell(JRExporterGridCell cell,
int rowHeight)
|
protected void |
writeImageAreaCoordinates(int[] coords)
|
protected void |
writeImageAreaHyperlink(JRPrintHyperlink hyperlink)
|
protected void |
writeImageMap(String imageMapName,
JRPrintImage image,
List<JRPrintImageAreaHyperlink> imageMapAreas)
|
| Methods inherited from class net.sf.jasperreports.engine.JRAbstractExporter |
createFilter, defaultParseNumber, getBooleanCellValue, getBooleanParameter, getCharacterParameter, 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, setOffset, setOffset, setOutput, setPageRange, setParameter, setParameters, setReportContext |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HTML_EXPORTER_KEY
public static final String HTML_EXPORTER_KEY
- The exporter key, as used in
GenericElementHandlerEnviroment.getHandler(net.sf.jasperreports.engine.JRGenericElementType, String).
- See Also:
- Constant Field Values
PROPERTY_HTML_CLASS
public static final String PROPERTY_HTML_CLASS
- See Also:
- Constant Field Values
PROPERTY_HTML_POPUP_ID
public static final String PROPERTY_HTML_POPUP_ID
- See Also:
- Constant Field Values
PROPERTY_HTML_POPUP_COLUMN
public static final String PROPERTY_HTML_POPUP_COLUMN
- See Also:
- Constant Field Values
PROPERTY_HTML_UUID
public static final String PROPERTY_HTML_UUID
- See Also:
- Constant Field Values
PROPERTY_HTML_ID
public static final String PROPERTY_HTML_ID
- See Also:
- Constant Field Values
PROPERTY_ACCESSIBLE
public static final String PROPERTY_ACCESSIBLE
- Configuration property that determines the exporter to produce accessible HTML.
- See Also:
- Constant Field Values
JR_PAGE_ANCHOR_PREFIX
protected static final String JR_PAGE_ANCHOR_PREFIX
- See Also:
- Constant Field Values
DEFAULT_ZOOM
protected static final float DEFAULT_ZOOM
- See Also:
- Constant Field Values
CSS_TEXT_ALIGN_LEFT
protected static final String CSS_TEXT_ALIGN_LEFT
- See Also:
- Constant Field Values
CSS_TEXT_ALIGN_RIGHT
protected static final String CSS_TEXT_ALIGN_RIGHT
- See Also:
- Constant Field Values
CSS_TEXT_ALIGN_CENTER
protected static final String CSS_TEXT_ALIGN_CENTER
- See Also:
- Constant Field Values
CSS_TEXT_ALIGN_JUSTIFY
protected static final String CSS_TEXT_ALIGN_JUSTIFY
- See Also:
- Constant Field Values
HTML_VERTICAL_ALIGN_TOP
protected static final String HTML_VERTICAL_ALIGN_TOP
- See Also:
- Constant Field Values
HTML_VERTICAL_ALIGN_MIDDLE
protected static final String HTML_VERTICAL_ALIGN_MIDDLE
- See Also:
- Constant Field Values
HTML_VERTICAL_ALIGN_BOTTOM
protected static final String HTML_VERTICAL_ALIGN_BOTTOM
- See Also:
- Constant Field Values
IMAGE_NAME_PREFIX
public static final String IMAGE_NAME_PREFIX
- See Also:
- Constant Field Values
IMAGE_NAME_PREFIX_LEGTH
protected static final int IMAGE_NAME_PREFIX_LEGTH
writer
protected Writer writer
progressMonitor
protected JRExportProgressMonitor progressMonitor
rendererToImagePathMap
protected Map<String,String> rendererToImagePathMap
imageMaps
protected Map<Pair<String,Rectangle>,String> imageMaps
imageNameToImageDataMap
protected Map<String,byte[]> imageNameToImageDataMap
imagesToProcess
protected List<JRPrintElementIndex> imagesToProcess
isPxImageLoaded
protected boolean isPxImageLoaded
reportIndex
protected int reportIndex
pageIndex
protected int pageIndex
imagesDir
protected File imagesDir
imagesURI
protected String imagesURI
isOutputImagesToDir
protected boolean isOutputImagesToDir
isRemoveEmptySpace
protected boolean isRemoveEmptySpace
isWhitePageBackground
protected boolean isWhitePageBackground
encoding
protected String encoding
sizeUnit
protected String sizeUnit
zoom
protected float zoom
isUsingImagesToAlign
protected boolean isUsingImagesToAlign
isWrapBreakWord
protected boolean isWrapBreakWord
isIgnorePageMargins
protected boolean isIgnorePageMargins
accessibleHtml
protected boolean accessibleHtml
flushOutput
protected boolean flushOutput
htmlHeader
protected String htmlHeader
betweenPagesHtml
protected String betweenPagesHtml
htmlFooter
protected String htmlFooter
emptyCellStringProvider
protected JRHtmlExporter.StringProvider emptyCellStringProvider
targetProducerFactory
protected JRHyperlinkTargetProducerFactory targetProducerFactory
hyperlinkStarted
protected boolean hyperlinkStarted
thDepth
protected int thDepth
nature
protected ExporterNature nature
exporterContext
protected JRHtmlExporterContext exporterContext
JRHtmlExporter
public JRHtmlExporter()
- See Also:
JRHtmlExporter(JasperReportsContext)
JRHtmlExporter
public JRHtmlExporter(JasperReportsContext jasperReportsContext)
exportReport
public void exportReport()
throws JRException
- Description copied from interface:
JRExporter
- Actually starts the export process.
- Specified by:
exportReport in interface JRExporter- Specified by:
exportReport in class JRAbstractExporter
- Throws:
JRException
getImage
public static JRPrintImage getImage(List<JasperPrint> jasperPrintList,
String imageName)
getImage
public static JRPrintImage getImage(List<JasperPrint> jasperPrintList,
JRPrintElementIndex imageIndex)
exportReportToWriter
protected void exportReportToWriter()
throws JRException,
IOException
- Throws:
JRException
IOException
exportPage
protected void exportPage(JRPrintPage page)
throws JRException,
IOException
- Throws:
JRException
IOException
exportGrid
protected void exportGrid(JRGridLayout gridLayout,
boolean whitePageBackground)
throws IOException,
JRException
- Throws:
IOException
JRException
writeEmptyCell
protected void writeEmptyCell(JRExporterGridCell cell,
int rowHeight)
throws IOException
- Throws:
IOException
exportLine
protected void exportLine(JRPrintLine line,
JRExporterGridCell gridCell)
throws IOException
- Throws:
IOException
writeCellStart
protected void writeCellStart(JRExporterGridCell gridCell)
throws IOException
- Throws:
IOException
writeCellEnd
protected void writeCellEnd(JRExporterGridCell gridCell)
throws IOException
- Throws:
IOException
getCellTag
protected String getCellTag(JRExporterGridCell gridCell)
exportRectangle
protected void exportRectangle(JRPrintGraphicElement element,
JRExporterGridCell gridCell)
throws IOException
- Throws:
IOException
exportStyledText
protected void exportStyledText(JRStyledText styledText,
Locale locale)
throws IOException
- Throws:
IOException
exportStyledText
protected void exportStyledText(JRStyledText styledText,
String tooltip,
Locale locale)
throws IOException
- Throws:
IOException
exportStyledTextRun
protected void exportStyledTextRun(Map<AttributedCharacterIterator.Attribute,Object> attributes,
String text,
Locale locale)
throws IOException
- Throws:
IOException
exportStyledTextRun
protected void exportStyledTextRun(Map<AttributedCharacterIterator.Attribute,Object> attributes,
String text,
String tooltip,
Locale locale)
throws IOException
- Throws:
IOException
exportText
protected void exportText(JRPrintText text,
JRExporterGridCell gridCell)
throws IOException
- Throws:
IOException
startHyperlink
protected boolean startHyperlink(JRPrintHyperlink link)
throws IOException
- Throws:
IOException
getHyperlinkTarget
protected String getHyperlinkTarget(JRPrintHyperlink link)
getHyperlinkURL
protected String getHyperlinkURL(JRPrintHyperlink link)
endHyperlink
protected void endHyperlink()
throws IOException
- Throws:
IOException
appendBorderStyle
protected boolean appendBorderStyle(JRLineBox box,
StringBuffer styleBuffer)
appendPaddingStyle
protected boolean appendPaddingStyle(JRLineBox box,
StringBuffer styleBuffer)
appendBackcolorStyle
protected Color appendBackcolorStyle(JRExporterGridCell gridCell,
StringBuffer styleBuffer)
exportImage
protected void exportImage(JRPrintImage image,
JRExporterGridCell gridCell)
throws JRException,
IOException
- Throws:
JRException
IOException
getElementIndex
protected JRPrintElementIndex getElementIndex(JRExporterGridCell gridCell)
writeImageMap
protected void writeImageMap(String imageMapName,
JRPrintImage image,
List<JRPrintImageAreaHyperlink> imageMapAreas)
throws IOException
- Throws:
IOException
writeImageAreaCoordinates
protected void writeImageAreaCoordinates(int[] coords)
throws IOException
- Throws:
IOException
writeImageAreaHyperlink
protected void writeImageAreaHyperlink(JRPrintHyperlink hyperlink)
throws IOException
- Throws:
IOException
loadPxImage
protected void loadPxImage()
throws JRException
- Throws:
JRException
getImageName
public static String getImageName(JRPrintElementIndex printElementIndex)
getPrintElementIndex
public static JRPrintElementIndex getPrintElementIndex(String imageName)
exportFrame
protected void exportFrame(JRPrintFrame frame,
JRExporterGridCell gridCell)
throws IOException,
JRException
- Throws:
IOException
JRException
setBackcolor
protected void setBackcolor(Color color)
restoreBackcolor
protected void restoreBackcolor()
exportGenericElement
protected void exportGenericElement(JRGenericPrintElement element,
JRExporterGridCell gridCell,
int rowHeight)
throws IOException
- Throws:
IOException
getExportParameters
public Map<JRExporterParameter,Object> getExportParameters()
getExportPropertiesPrefix
public String getExportPropertiesPrefix()
getExporterKey
protected String getExporterKey()
- Specified by:
getExporterKey in class JRAbstractExporter
getExportedReport
public JasperPrint getExportedReport()
toSizeUnit
public String toSizeUnit(int size)
toZoom
public int toZoom(int size)
getStyledText
protected JRStyledText getStyledText(JRPrintText textElement,
boolean setBackcolor)
- Overrides:
getStyledText in class JRAbstractExporter
Copyright © 2012. All Rights Reserved.