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.
Since classic AWT fonts can be sometimes very different from HTML fonts, a font mapping feature was added.
By using the JRExporterParameter.FONT_MAP
parameter, a logical font like "sansserif" can be mapped to a
list of HTML specific fonts, like "Arial, Verdana, Tahoma". Both map keys and values are strings.
- Version:
- $Id: JRHtmlExporter.java 1508 2006-11-28 19:09:17 +0200 (Tue, 28 Nov 2006) teodord $
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
Fields inherited from class net.sf.jasperreports.engine.JRAbstractExporter |
classLoader, classLoaderSet, dateFormatCache, endPageIndex, globalOffsetX, globalOffsetY, isModeBatch, jasperPrint, jasperPrintList, numberFormatCache, parameters, startPageIndex, styledTextParser, urlHandlerFactory, urlHandlerFactorySet |
Method Summary |
protected java.awt.Color |
appendBackcolorStyle(JRPrintElement element,
java.lang.StringBuffer styleBuffer)
|
protected void |
appendBorderStyle(JRPrintElement element,
JRBox box,
java.lang.StringBuffer styleBuffer)
|
protected void |
endHyperlink()
|
protected void |
exportFrame(JRPrintFrame frame,
JRExporterGridCell gridCell)
|
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(JRPrintElement element,
JRExporterGridCell gridCell)
|
void |
exportReport()
Actually starts the export process. |
protected void |
exportReportToWriter()
|
protected void |
exportStyledText(JRStyledText styledText)
|
protected void |
exportStyledTextRun(java.util.Map attributes,
java.lang.String text)
|
protected void |
exportText(JRPrintText text,
JRExporterGridCell gridCell)
|
protected JRPrintElementIndex |
getElementIndex(JRExporterGridCell gridCell)
|
protected java.lang.String |
getHyperlinkTarget(JRPrintHyperlink link)
|
protected java.lang.String |
getHyperlinkURL(JRPrintHyperlink link)
|
static JRPrintImage |
getImage(java.util.List jasperPrintList,
JRPrintElementIndex imageIndex)
|
static JRPrintImage |
getImage(java.util.List jasperPrintList,
java.lang.String imageName)
|
static java.lang.String |
getImageName(JRPrintElementIndex printElementIndex)
|
protected JRGridLayout |
getPageGridLayout(JRPrintPage page)
|
static JRPrintElementIndex |
getPrintElementIndex(java.lang.String imageName)
|
protected void |
loadPxImage()
|
protected void |
restoreBackcolor()
|
protected void |
setBackcolor(java.awt.Color color)
|
protected void |
setHyperlinkProducerFactory()
|
protected boolean |
startHyperlink(JRPrintHyperlink link)
|
protected void |
writeCellTDStart(JRExporterGridCell gridCell)
|
protected void |
writeImageAreaCoordinates(JRPrintImageArea area)
|
protected void |
writeImageAreaHyperlink(JRPrintHyperlink hyperlink)
|
protected void |
writeImageMap(java.lang.String imageMapName,
JRPrintHyperlink mainHyperlink,
java.util.List imageMapAreas)
|
Methods inherited from class net.sf.jasperreports.engine.JRAbstractExporter |
defaultParseNumber, getBooleanCellValue, getBox, getDateCellValue, getDateFormat, getNumberCellValue, getNumberFormat, getOffsetX, getOffsetY, getParameter, getParameters, getStyledText, getStyledText, getTextFormatFactoryClass, getTextLocale, getTextTimeZone, getTextValue, getTextValueString, reset, resetClassLoader, resetExportContext, restoreElementOffsets, setClassLoader, setExportContext, setFrameElementsOffset, setInput, setOffset, setOutput, setPageRange, setParameter, setParameters |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JR_PAGE_ANCHOR_PREFIX
protected static final java.lang.String JR_PAGE_ANCHOR_PREFIX
- See Also:
- Constant Field Values
CSS_TEXT_ALIGN_LEFT
protected static final java.lang.String CSS_TEXT_ALIGN_LEFT
- See Also:
- Constant Field Values
CSS_TEXT_ALIGN_RIGHT
protected static final java.lang.String CSS_TEXT_ALIGN_RIGHT
- See Also:
- Constant Field Values
CSS_TEXT_ALIGN_CENTER
protected static final java.lang.String CSS_TEXT_ALIGN_CENTER
- See Also:
- Constant Field Values
CSS_TEXT_ALIGN_JUSTIFY
protected static final java.lang.String CSS_TEXT_ALIGN_JUSTIFY
- See Also:
- Constant Field Values
HTML_VERTICAL_ALIGN_TOP
protected static final java.lang.String HTML_VERTICAL_ALIGN_TOP
- See Also:
- Constant Field Values
HTML_VERTICAL_ALIGN_MIDDLE
protected static final java.lang.String HTML_VERTICAL_ALIGN_MIDDLE
- See Also:
- Constant Field Values
HTML_VERTICAL_ALIGN_BOTTOM
protected static final java.lang.String HTML_VERTICAL_ALIGN_BOTTOM
- See Also:
- Constant Field Values
IMAGE_NAME_PREFIX
public static final java.lang.String IMAGE_NAME_PREFIX
- See Also:
- Constant Field Values
IMAGE_NAME_PREFIX_LEGTH
protected static final int IMAGE_NAME_PREFIX_LEGTH
writer
protected java.io.Writer writer
progressMonitor
protected JRExportProgressMonitor progressMonitor
rendererToImagePathMap
protected java.util.Map rendererToImagePathMap
imageMaps
protected java.util.Map imageMaps
imageNameToImageDataMap
protected java.util.Map imageNameToImageDataMap
imagesToProcess
protected java.util.List imagesToProcess
isPxImageLoaded
protected boolean isPxImageLoaded
reportIndex
protected int reportIndex
pageIndex
protected int pageIndex
imagesDir
protected java.io.File imagesDir
imagesURI
protected java.lang.String imagesURI
isOutputImagesToDir
protected boolean isOutputImagesToDir
isRemoveEmptySpace
protected boolean isRemoveEmptySpace
isWhitePageBackground
protected boolean isWhitePageBackground
encoding
protected java.lang.String encoding
sizeUnit
protected java.lang.String sizeUnit
htmlHeader
protected java.lang.String htmlHeader
betweenPagesHtml
protected java.lang.String betweenPagesHtml
htmlFooter
protected java.lang.String htmlFooter
emptyCellStringProvider
protected JRHtmlExporter.StringProvider emptyCellStringProvider
colorMask
protected static final int colorMask
isWrapBreakWord
protected boolean isWrapBreakWord
fontMap
protected java.util.Map fontMap
hyperlinkProducerFactory
protected JRHyperlinkProducerFactory hyperlinkProducerFactory
JRHtmlExporter
public JRHtmlExporter()
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
setHyperlinkProducerFactory
protected void setHyperlinkProducerFactory()
getImage
public static JRPrintImage getImage(java.util.List jasperPrintList,
java.lang.String imageName)
getImage
public static JRPrintImage getImage(java.util.List jasperPrintList,
JRPrintElementIndex imageIndex)
exportReportToWriter
protected void exportReportToWriter()
throws JRException,
java.io.IOException
- Throws:
JRException
java.io.IOException
exportPage
protected void exportPage(JRPrintPage page)
throws JRException,
java.io.IOException
- Throws:
JRException
java.io.IOException
exportGrid
protected void exportGrid(JRGridLayout gridLayout,
boolean whitePageBackground)
throws java.io.IOException,
JRException
- Throws:
java.io.IOException
JRException
exportLine
protected void exportLine(JRPrintLine line,
JRExporterGridCell gridCell)
throws java.io.IOException
- Throws:
java.io.IOException
writeCellTDStart
protected void writeCellTDStart(JRExporterGridCell gridCell)
throws java.io.IOException
- Throws:
java.io.IOException
exportRectangle
protected void exportRectangle(JRPrintElement element,
JRExporterGridCell gridCell)
throws java.io.IOException
- Throws:
java.io.IOException
exportStyledText
protected void exportStyledText(JRStyledText styledText)
throws java.io.IOException
- Throws:
java.io.IOException
exportStyledTextRun
protected void exportStyledTextRun(java.util.Map attributes,
java.lang.String text)
throws java.io.IOException
- Throws:
java.io.IOException
exportText
protected void exportText(JRPrintText text,
JRExporterGridCell gridCell)
throws java.io.IOException
- Throws:
java.io.IOException
startHyperlink
protected boolean startHyperlink(JRPrintHyperlink link)
throws java.io.IOException
- Throws:
java.io.IOException
getHyperlinkTarget
protected java.lang.String getHyperlinkTarget(JRPrintHyperlink link)
getHyperlinkURL
protected java.lang.String getHyperlinkURL(JRPrintHyperlink link)
endHyperlink
protected void endHyperlink()
throws java.io.IOException
- Throws:
java.io.IOException
appendBorderStyle
protected void appendBorderStyle(JRPrintElement element,
JRBox box,
java.lang.StringBuffer styleBuffer)
appendBackcolorStyle
protected java.awt.Color appendBackcolorStyle(JRPrintElement element,
java.lang.StringBuffer styleBuffer)
exportImage
protected void exportImage(JRPrintImage image,
JRExporterGridCell gridCell)
throws JRException,
java.io.IOException
- Throws:
JRException
java.io.IOException
getElementIndex
protected JRPrintElementIndex getElementIndex(JRExporterGridCell gridCell)
writeImageMap
protected void writeImageMap(java.lang.String imageMapName,
JRPrintHyperlink mainHyperlink,
java.util.List imageMapAreas)
throws java.io.IOException
- Throws:
java.io.IOException
writeImageAreaCoordinates
protected void writeImageAreaCoordinates(JRPrintImageArea area)
throws java.io.IOException
- Throws:
java.io.IOException
writeImageAreaHyperlink
protected void writeImageAreaHyperlink(JRPrintHyperlink hyperlink)
throws java.io.IOException
- Throws:
java.io.IOException
getPageGridLayout
protected JRGridLayout getPageGridLayout(JRPrintPage page)
loadPxImage
protected void loadPxImage()
throws JRException
- Throws:
JRException
getImageName
public static java.lang.String getImageName(JRPrintElementIndex printElementIndex)
getPrintElementIndex
public static JRPrintElementIndex getPrintElementIndex(java.lang.String imageName)
exportFrame
protected void exportFrame(JRPrintFrame frame,
JRExporterGridCell gridCell)
throws java.io.IOException,
JRException
- Throws:
java.io.IOException
JRException
setBackcolor
protected void setBackcolor(java.awt.Color color)
restoreBackcolor
protected void restoreBackcolor()
© 2001-2006 JasperSoft Corporation www.jaspersoft.com