net.sf.jasperreports.engine.export.ooxml
Class JRXlsxExporter
java.lang.Object
net.sf.jasperreports.engine.JRAbstractExporter
net.sf.jasperreports.engine.export.JRXlsAbstractExporter
net.sf.jasperreports.engine.export.ooxml.JRXlsxExporter
- All Implemented Interfaces:
- JRExporter
public class JRXlsxExporter
- extends JRXlsAbstractExporter
Exports a JasperReports document to XLSX format. It has character output type and exports the document to a
grid-based layout.
- Version:
- $Id: JRDocxExporter.java 2943 2009-07-23 19:45:12Z teodord $
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
Fields inherited from class net.sf.jasperreports.engine.export.JRXlsAbstractExporter |
currentSheetName, defaultFont, fontMap, isAutoDetectCellType, isCollapseRowSpan, isDetectCellType, isFontSizeFixEnabled, isIgnoreCellBackground, isIgnoreCellBorder, isIgnoreGraphics, isIgnorePageMargins, isImageBorderFixEnabled, isOnePagePerSheet, isRemoveEmptySpaceBetweenColumns, isRemoveEmptySpaceBetweenRows, isWhitePageBackground, loadedFonts, maxRowsPerSheet, pageIndex, reportIndex, sheetIndex, sheetNames, sheetNamesMap, XLS_EXPORTER_PROPERTIES_PREFIX |
Fields inherited from class net.sf.jasperreports.engine.JRAbstractExporter |
classLoader, classLoaderSet, dateFormatCache, endPageIndex, fileResolver, fileResolverSet, filter, globalOffsetX, globalOffsetY, hyperlinkProducerFactory, isModeBatch, jasperPrint, jasperPrintList, numberFormatCache, parameters, PROPERTY_CELL_FORMULA, PROPERTY_DEFAULT_FILTER_FACTORY, PROPERTY_SUFFIX_DEFAULT_FILTER_FACTORY, startPageIndex, urlHandlerFactory, urlHandlerFactorySet |
Method Summary |
protected void |
addBlankCell(JRExporterGridCell gridCell,
int colIndex,
int rowIndex)
|
protected void |
addOccupiedCell(OccupiedGridCell occupiedGridCell,
int colIndex,
int rowIndex)
|
protected void |
closeSheet()
|
protected void |
closeWorkbook(java.io.OutputStream os)
|
protected void |
createSheet(java.lang.String name)
|
protected void |
exportFrame(JRPrintFrame frame,
JRExporterGridCell gridCell,
int colIndex,
int rowIndex)
|
protected void |
exportGenericElement(JRGenericPrintElement element,
JRExporterGridCell gridCell,
int colIndex,
int rowIndex,
int emptyCols)
|
protected void |
exportImage(JRPrintImage image,
JRExporterGridCell gridCell,
int colIndex,
int rowIndex,
int emptyCols)
|
protected void |
exportLine(JRPrintLine line,
JRExporterGridCell gridCell,
int colIndex,
int rowIndex)
|
protected void |
exportRectangle(JRPrintGraphicElement rectangle,
JRExporterGridCell gridCell,
int colIndex,
int rowIndex)
|
protected void |
exportStyledText(JRStyle style,
JRStyledText styledText,
java.util.Locale locale)
|
void |
exportText(JRPrintText text,
JRExporterGridCell gridCell,
int colIndex,
int rowIndex)
|
protected JRPrintElementIndex |
getElementIndex(JRExporterGridCell gridCell)
|
protected java.lang.String |
getExporterKey()
|
protected java.lang.String |
getExporterPropertiesPrefix()
|
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)
|
protected java.lang.String |
getImagePath(JRRenderable renderer,
boolean isLazy,
JRExporterGridCell gridCell)
|
protected ExporterNature |
getNature()
|
static JRPrintElementIndex |
getPrintElementIndex(java.lang.String imageName)
protected void writeImageMap(String imageMapName, JRPrintHyperlink mainHyperlink, List imageMapAreas) throws IOException
{
writer.write("\n");
}
protected void writeImageAreaCoordinates(JRPrintImageArea area) throws IOException
{
int[] coords = area.getCoordinates();
if (coords != null && coords.length > 0)
{
StringBuffer coordsEnum = new StringBuffer(coords.length * 4);
coordsEnum.append(coords[0]);
for (int i = 1; i < coords.length; i++)
{
coordsEnum.append(',');
coordsEnum.append(coords[i]);
}
writer.write(" coords=\"" + coordsEnum + "\"");
}
}
protected void writeImageAreaHyperlink(JRPrintHyperlink hyperlink) throws IOException
{
String href = getHyperlinkURL(hyperlink);
if (href == null)
{
writer.write(" nohref=\"nohref\"");
}
else
{
writer.write(" href=\"" + href + "\"");
String target = getHyperlinkTarget(hyperlink);
if (target != null)
{
writer.write(" target=\"");
writer.write(target);
writer.write("\"");
}
}
if (hyperlink.getHyperlinkTooltip() != null)
{
writer.write(" title=\"");
writer.write(JRStringUtil.xmlEncode(hyperlink.getHyperlinkTooltip()));
writer.write("\"");
}
}
/** |
protected void |
openWorkbook(java.io.OutputStream os)
|
protected void |
removeColumn(int col)
|
protected void |
restoreBackcolor()
|
protected void |
setBackcolor(java.awt.Color color)
|
protected void |
setBackground()
|
protected void |
setCell(JRExporterGridCell gridCell,
int colIndex,
int rowIndex)
|
protected void |
setColumnWidth(int col,
int width)
|
protected void |
setParameters()
|
protected void |
setRowHeight(int rowIndex,
int rowHeight)
|
Methods inherited from class net.sf.jasperreports.engine.export.JRXlsAbstractExporter |
calculateHeightForDinAN, calculateHeightForDinBN, calculateHeightForDinCN, calculateWidthForDinAN, calculateWidthForDinBN, calculateWidthForDinCN, exportPage, exportReport, exportReportToStream, getDefaultFont, getImageBorderCorrection, getStyledText, getTextAlignHolder, removeEmptyColumns, setColumnWidths |
Methods inherited from class net.sf.jasperreports.engine.JRAbstractExporter |
createFilter, defaultParseNumber, getBooleanCellValue, getBooleanParameter, getCharacterParameter, getCustomHandler, getDateCellValue, getDateFormat, getFloatParameter, getHyperlinkProducer, getIntegerParameter, getLocale, getNumberCellValue, getNumberFormat, getOffsetX, getOffsetY, getParameter, getParameterResolver, getParameters, getStringArrayParameter, getStringParameter, getStringParameterOrDefault, getStyledText, getTextFormatFactoryClass, getTextLocale, getTextTimeZone, getTextValue, getTextValueString, reset, resetClassLoader, resetExportContext, restoreElementOffsets, setClassLoader, setExportContext, setFrameElementsOffset, setHyperlinkProducerFactory, setInput, setJasperPrint, setOffset, setOffset, setOutput, setPageRange, setParameter, setParameters |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XLSX_EXPORTER_KEY
public static final java.lang.String XLSX_EXPORTER_KEY
- The exporter key, as used in
GenericElementHandlerEnviroment.getHandler(net.sf.jasperreports.engine.JRGenericElementType, String)
.
- See Also:
- Constant Field Values
XLSX_EXPORTER_PROPERTIES_PREFIX
protected static final java.lang.String XLSX_EXPORTER_PROPERTIES_PREFIX
- See Also:
- Constant Field Values
JR_PAGE_ANCHOR_PREFIX
protected static final java.lang.String JR_PAGE_ANCHOR_PREFIX
- 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
xlsxZip
protected XlsxZip xlsxZip
wbHelper
protected XlsxWorkbookHelper wbHelper
relsHelper
protected XlsxRelsHelper relsHelper
ctHelper
protected XlsxContentTypesHelper ctHelper
sheetHelper
protected XlsxSheetHelper sheetHelper
sheetRelsHelper
protected XlsxSheetRelsHelper sheetRelsHelper
drawingHelper
protected XlsxDrawingHelper drawingHelper
drawingRelsHelper
protected XlsxDrawingRelsHelper drawingRelsHelper
styleHelper
protected XlsxStyleHelper styleHelper
cellHelper
protected XlsxCellHelper cellHelper
progressMonitor
protected JRExportProgressMonitor progressMonitor
rendererToImagePathMap
protected java.util.Map rendererToImagePathMap
imageMaps
protected java.util.Map imageMaps
imagesToProcess
protected java.util.List imagesToProcess
tableIndex
protected int tableIndex
startPage
protected boolean startPage
isWrapBreakWord
protected boolean isWrapBreakWord
backcolorStack
protected java.util.LinkedList backcolorStack
backcolor
protected java.awt.Color backcolor
nature
protected ExporterNature nature
JRXlsxExporter
public JRXlsxExporter()
setParameters
protected void setParameters()
- Overrides:
setParameters
in class JRXlsAbstractExporter
getImage
public static JRPrintImage getImage(java.util.List jasperPrintList,
java.lang.String imageName)
getImage
public static JRPrintImage getImage(java.util.List jasperPrintList,
JRPrintElementIndex imageIndex)
exportStyledText
protected void exportStyledText(JRStyle style,
JRStyledText styledText,
java.util.Locale locale)
getImagePath
protected java.lang.String getImagePath(JRRenderable renderer,
boolean isLazy,
JRExporterGridCell gridCell)
getElementIndex
protected JRPrintElementIndex getElementIndex(JRExporterGridCell gridCell)
getPrintElementIndex
public static JRPrintElementIndex getPrintElementIndex(java.lang.String imageName)
- protected void writeImageMap(String imageMapName, JRPrintHyperlink mainHyperlink, List imageMapAreas) throws IOException
{
writer.write("\n");
}
protected void writeImageAreaCoordinates(JRPrintImageArea area) throws IOException
{
int[] coords = area.getCoordinates();
if (coords != null && coords.length > 0)
{
StringBuffer coordsEnum = new StringBuffer(coords.length * 4);
coordsEnum.append(coords[0]);
for (int i = 1; i < coords.length; i++)
{
coordsEnum.append(',');
coordsEnum.append(coords[i]);
}
writer.write(" coords=\"" + coordsEnum + "\"");
}
}
protected void writeImageAreaHyperlink(JRPrintHyperlink hyperlink) throws IOException
{
String href = getHyperlinkURL(hyperlink);
if (href == null)
{
writer.write(" nohref=\"nohref\"");
}
else
{
writer.write(" href=\"" + href + "\"");
String target = getHyperlinkTarget(hyperlink);
if (target != null)
{
writer.write(" target=\"");
writer.write(target);
writer.write("\"");
}
}
if (hyperlink.getHyperlinkTooltip() != null)
{
writer.write(" title=\"");
writer.write(JRStringUtil.xmlEncode(hyperlink.getHyperlinkTooltip()));
writer.write("\"");
}
}
/**
setBackcolor
protected void setBackcolor(java.awt.Color color)
restoreBackcolor
protected void restoreBackcolor()
getHyperlinkTarget
protected java.lang.String getHyperlinkTarget(JRPrintHyperlink link)
getHyperlinkURL
protected java.lang.String getHyperlinkURL(JRPrintHyperlink link)
getExporterPropertiesPrefix
protected java.lang.String getExporterPropertiesPrefix()
addBlankCell
protected void addBlankCell(JRExporterGridCell gridCell,
int colIndex,
int rowIndex)
throws JRException
- Specified by:
addBlankCell
in class JRXlsAbstractExporter
- Throws:
JRException
closeWorkbook
protected void closeWorkbook(java.io.OutputStream os)
throws JRException
- Specified by:
closeWorkbook
in class JRXlsAbstractExporter
- Throws:
JRException
createSheet
protected void createSheet(java.lang.String name)
- Specified by:
createSheet
in class JRXlsAbstractExporter
closeSheet
protected void closeSheet()
exportFrame
protected void exportFrame(JRPrintFrame frame,
JRExporterGridCell gridCell,
int colIndex,
int rowIndex)
throws JRException
- Specified by:
exportFrame
in class JRXlsAbstractExporter
- Throws:
JRException
exportImage
protected void exportImage(JRPrintImage image,
JRExporterGridCell gridCell,
int colIndex,
int rowIndex,
int emptyCols)
throws JRException
- Specified by:
exportImage
in class JRXlsAbstractExporter
- Throws:
JRException
exportLine
protected void exportLine(JRPrintLine line,
JRExporterGridCell gridCell,
int colIndex,
int rowIndex)
throws JRException
- Specified by:
exportLine
in class JRXlsAbstractExporter
- Throws:
JRException
exportRectangle
protected void exportRectangle(JRPrintGraphicElement rectangle,
JRExporterGridCell gridCell,
int colIndex,
int rowIndex)
throws JRException
- Specified by:
exportRectangle
in class JRXlsAbstractExporter
- Throws:
JRException
exportText
public void exportText(JRPrintText text,
JRExporterGridCell gridCell,
int colIndex,
int rowIndex)
throws JRException
- Specified by:
exportText
in class JRXlsAbstractExporter
- Throws:
JRException
exportGenericElement
protected void exportGenericElement(JRGenericPrintElement element,
JRExporterGridCell gridCell,
int colIndex,
int rowIndex,
int emptyCols)
throws JRException
- Specified by:
exportGenericElement
in class JRXlsAbstractExporter
- Throws:
JRException
getNature
protected ExporterNature getNature()
- Specified by:
getNature
in class JRXlsAbstractExporter
openWorkbook
protected void openWorkbook(java.io.OutputStream os)
throws JRException
- Specified by:
openWorkbook
in class JRXlsAbstractExporter
- Throws:
JRException
removeColumn
protected void removeColumn(int col)
- Specified by:
removeColumn
in class JRXlsAbstractExporter
setBackground
protected void setBackground()
- Specified by:
setBackground
in class JRXlsAbstractExporter
setCell
protected void setCell(JRExporterGridCell gridCell,
int colIndex,
int rowIndex)
- Specified by:
setCell
in class JRXlsAbstractExporter
addOccupiedCell
protected void addOccupiedCell(OccupiedGridCell occupiedGridCell,
int colIndex,
int rowIndex)
- Specified by:
addOccupiedCell
in class JRXlsAbstractExporter
setColumnWidth
protected void setColumnWidth(int col,
int width)
- Specified by:
setColumnWidth
in class JRXlsAbstractExporter
setRowHeight
protected void setRowHeight(int rowIndex,
int rowHeight)
throws JRException
- Specified by:
setRowHeight
in class JRXlsAbstractExporter
- Throws:
JRException
getExporterKey
protected java.lang.String getExporterKey()
- Specified by:
getExporterKey
in class JRAbstractExporter
© 2001-2010 Jaspersoft Corporation www.jaspersoft.com