net.sf.jasperreports.engine.export
Class JRHtmlExporter

java.lang.Object
  extended bynet.sf.jasperreports.engine.JRAbstractExporter
      extended bynet.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,v 1.53 2005/10/09 10:39:15 teodord Exp $
Author:
Teodor Danciu (teodord@users.sourceforge.net)

Nested Class Summary
protected static interface JRHtmlExporter.StringProvider
           
 
Field Summary
protected  java.lang.String betweenPagesHtml
           
protected static int colorMask
           
protected static java.lang.String CSS_TEXT_ALIGN_CENTER
           
protected static java.lang.String CSS_TEXT_ALIGN_JUSTIFY
           
protected static java.lang.String CSS_TEXT_ALIGN_LEFT
           
protected static java.lang.String CSS_TEXT_ALIGN_RIGHT
           
protected  JRHtmlExporter.StringProvider emptyCellStringProvider
           
protected  java.lang.String encoding
           
protected  java.util.Map fontMap
           
protected  JRExporterGridCell[][] grid
           
protected static java.lang.String HTML_VERTICAL_ALIGN_BOTTOM
           
protected static java.lang.String HTML_VERTICAL_ALIGN_MIDDLE
           
protected static java.lang.String HTML_VERTICAL_ALIGN_TOP
           
protected  java.lang.String htmlFooter
           
protected  java.lang.String htmlHeader
           
protected  java.util.Map imageNameToImageDataMap
           
protected  java.io.File imagesDir
           
protected  java.util.List imagesToProcess
           
protected  java.lang.String imagesURI
           
protected  boolean isOutputImagesToDir
           
protected  boolean isPxImageLoaded
           
protected  boolean isRemoveEmptySpace
           
protected  boolean[] isRowNotEmpty
           
protected  boolean isWhitePageBackground
           
protected  boolean isWrapBreakWord
           
protected static java.lang.String JR_PAGE_ANCHOR_PREFIX
           
protected  int pageIndex
           
protected  JRExportProgressMonitor progressMonitor
           
protected  java.util.Map rendererToImagePathMap
           
protected  int reportIndex
           
protected  java.lang.String sizeUnit
           
protected  java.io.Writer writer
           
protected  java.util.List xCuts
           
protected  java.util.List yCuts
           
 
Fields inherited from class net.sf.jasperreports.engine.JRAbstractExporter
classLoader, defaultFont, endPageIndex, globalOffsetX, globalOffsetY, isModeBatch, jasperPrint, jasperPrintList, parameters, startPageIndex, styledTextParser
 
Constructor Summary
JRHtmlExporter()
           
 
Method Summary
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)
           
static java.lang.String getImageName(JRPrintElementIndex printElementIndex)
           
static JRPrintElementIndex getPrintElementIndex(java.lang.String imageName)
           
protected  void layoutGrid(JRPrintPage page)
           
protected  void loadPxImage()
           
 
Methods inherited from class net.sf.jasperreports.engine.JRAbstractExporter
getDefaultFont, getParameter, getParameters, getStyledText, resetClassLoader, setClassLoader, setInput, setOffset, setOutput, setPageRange, setParameter, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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

writer

protected java.io.Writer writer

progressMonitor

protected JRExportProgressMonitor progressMonitor

rendererToImagePathMap

protected java.util.Map rendererToImagePathMap

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

grid

protected JRExporterGridCell[][] grid

isRowNotEmpty

protected boolean[] isRowNotEmpty

xCuts

protected java.util.List xCuts

yCuts

protected java.util.List yCuts

isWrapBreakWord

protected boolean isWrapBreakWord

fontMap

protected java.util.Map fontMap
Constructor Detail

JRHtmlExporter

public JRHtmlExporter()
Method Detail

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

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

exportLine

protected void exportLine(JRPrintLine line,
                          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

exportImage

protected void exportImage(JRPrintImage image,
                           JRExporterGridCell gridCell)
                    throws JRException,
                           java.io.IOException
Throws:
JRException
java.io.IOException

layoutGrid

protected void layoutGrid(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)


© 2001-2005 JasperSoft Corporation www.jaspersoft.com