public class ExcelWriter extends AbstractWriter
DataEndpoint.State| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_CELL_LENGTH |
static int |
MAX_CELL_LENGTH_INDEX |
currentRecordlastRecord, PRODUCT, PRODUCT_VERSION, VENDOR, XML_INPUT_FACTORY_KEYBUFFER_SIZE, captureElapsedTime, DEFAULT_READ_BUFFER_SIZEid, log, name, TIMESTAMP_FORMAT| Constructor and Description |
|---|
ExcelWriter(ExcelDocument document) |
| Modifier and Type | Method and Description |
|---|---|
ExcelWriter |
addDataCellStyle(FieldLocationPredicate predicate,
ExcelCellStyleDecorator decorator)
Adds cell styles to data cells matching the specified predicate.
|
ExcelWriter |
addDataHyperlink(FieldLocationPredicate predicate,
ExcelHyperlinkFunction function)
Adds hyperlinks to data cells matching the specified predicate.
|
protected void |
addDataMetadata(Record record) |
DataException |
addExceptionProperties(DataException exception)
Adds this endpoint's current state to a
DataException. |
ExcelWriter |
addHeaderCellStyle(FieldLocationPredicate predicate,
ExcelCellStyleDecorator decorator)
Adds cell styles to header cells matching the specified predicate.
|
ExcelWriter |
addHeaderHyperlink(FieldLocationPredicate predicate,
ExcelHyperlinkFunction function)
Adds hyperlinks to header cells matching the specified predicate.
|
protected void |
addHeaderMetadata(Record record) |
void |
close()
Indicates that this endpoint has finished reading or writing.
|
ExcelDocument |
getDocument() |
int |
getFirstColumnIndex() |
int |
getFirstRowIndex() |
Integer |
getFreezeColumns()
Returns the number of columns to freeze at the left side of the Excel sheet.
Supported ProviderTypes are: |
Integer |
getFreezeRows()
Returns the number of rows to freeze at the top of the Excel sheet.
Supported ProviderTypes are: |
LargeCellHandler |
getLargeCellHandler() |
int |
getSheetIndex() |
String |
getSheetName() |
void |
initStyles()
Initializes default cell style formats for different field types.
|
boolean |
isAutofilterColumns() |
boolean |
isAutofitColumns() |
boolean |
isWriteMetadata()
Returns whether Excel metadata (such as hyperlinks and cell styles) should be written.
|
void |
open()
Makes this endpoint ready for reading or writing.
|
ExcelWriter |
setAutoFilterColumns(boolean autoFilterColumns)
Indicates if a row containing a drop-down filter with values from each column should be added above the data rows.
|
ExcelWriter |
setAutofitColumns(boolean autofitColumns)
Indicates if the columns should be expanded to fit the widest value.
|
ExcelWriter |
setDataFormat(FieldType fieldType,
String dataFormat)
Sets the data format for cells containing values of the specified field type.
|
ExcelWriter |
setDescription(String description) |
ExcelWriter |
setFieldNamesInFirstRow(boolean fieldNamesInFirstRow) |
ExcelWriter |
setFirstColumnIndex(int firstColumnIndex) |
ExcelWriter |
setFirstRowIndex(int firstRowIndex) |
ExcelWriter |
setFreezeColumns(Integer freezeColumns)
Sets the number of columns to freeze at the left side of the Excel sheet.
Supported ProviderTypes are: |
ExcelWriter |
setFreezeRows(Integer freezeRows)
Sets the number of rows to freeze at the top of the Excel sheet.
|
ExcelWriter |
setLargeCellHandler(LargeCellHandler largeCellHandler) |
ExcelWriter |
setSheetIndex(int sheetIndex) |
ExcelWriter |
setSheetName(String sheetName) |
ExcelWriter |
setStyleFormat(FieldType fieldType,
String dataFormat)
Deprecated.
use
setDataFormat(FieldType, String) instead.
Sets the data format for cells containing values of the specified field type. |
ExcelWriter |
setWriteMetadata(boolean writeMetadata)
Sets whether Excel metadata (such as hyperlinks and cell styles) should be written.
|
protected void |
writeRecord(Record record) |
createHeaderRecord, isFieldNamesInFirstRow, isHeaderRow, write, writeImplavailable, getNestedEndpoint, getNestedWriter, getRootEndpoint, getRootWriter, getWriterdecrementRecordCount, enableJmx, getLastRecord, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, incrementRecordCount, isRecordCountBigInteger, resetRecordCount, toStringaddElapsedtime, assertClosed, assertNotOpened, assertOpened, finalize, getClosedOn, getDescription, getElapsedTime, getElapsedTimeAsString, getOpenedOn, getOpenElapsedTime, getOpenElapsedTimeAsString, getSelfTime, getSelfTimeAsString, getState, isCaptureElapsedTime, isClosed, isOpen, setCaptureElapsedTimepublic static final int MAX_CELL_LENGTH
public static final int MAX_CELL_LENGTH_INDEX
public ExcelWriter(ExcelDocument document)
public void initStyles()
public DataException addExceptionProperties(DataException exception)
EndpointDataException. Since this method is called whenever an
exception is thrown, subclasses should override it to add their specific information.addExceptionProperties in class AbstractWriterpublic boolean isAutofitColumns()
public ExcelWriter setAutofitColumns(boolean autofitColumns)
public boolean isAutofilterColumns()
public ExcelWriter setAutoFilterColumns(boolean autoFilterColumns)
public String getSheetName()
public ExcelWriter setSheetName(String sheetName)
public int getSheetIndex()
public ExcelWriter setSheetIndex(int sheetIndex)
public int getFirstColumnIndex()
public ExcelWriter setFirstColumnIndex(int firstColumnIndex)
public int getFirstRowIndex()
public ExcelWriter setFirstRowIndex(int firstRowIndex)
public ExcelWriter setFieldNamesInFirstRow(boolean fieldNamesInFirstRow)
setFieldNamesInFirstRow in class AbstractWriterpublic LargeCellHandler getLargeCellHandler()
public ExcelWriter setLargeCellHandler(LargeCellHandler largeCellHandler)
public Integer getFreezeRows()
-ExcelDocument.ProviderType.POI, -ExcelDocument.ProviderType.POI_XSSF, -ExcelDocument.ProviderType.POI_SXSSF, -ExcelDocument.ProviderType.POI_XSSF_SAX
public ExcelWriter setFreezeRows(Integer freezeRows)
-ExcelDocument.ProviderType.POI, -ExcelDocument.ProviderType.POI_XSSF, -ExcelDocument.ProviderType.POI_SXSSF, -ExcelDocument.ProviderType.POI_XSSF_SAX
public Integer getFreezeColumns()
-ExcelDocument.ProviderType.POI, -ExcelDocument.ProviderType.POI_XSSF, -ExcelDocument.ProviderType.POI_SXSSF, -ExcelDocument.ProviderType.POI_XSSF_SAX
public ExcelWriter setFreezeColumns(Integer freezeColumns)
-ExcelDocument.ProviderType.POI, -ExcelDocument.ProviderType.POI_XSSF, -ExcelDocument.ProviderType.POI_SXSSF, -ExcelDocument.ProviderType.POI_XSSF_SAX
public boolean isWriteMetadata()
ExcelFieldMetadatapublic ExcelWriter setWriteMetadata(boolean writeMetadata)
writeMetadata - true to enable metadata writing, false to disable (default is false)ExcelFieldMetadatapublic ExcelWriter setDescription(String description)
setDescription in class Endpointpublic void open()
DataEndpointopen in class AbstractWriterpublic void close()
DataEndpointclose in class DataEndpointpublic ExcelDocument getDocument()
protected void writeRecord(Record record) throws Throwable
writeRecord in class AbstractWriterThrowable@Deprecated public ExcelWriter setStyleFormat(FieldType fieldType, String dataFormat)
setDataFormat(FieldType, String) instead.
Sets the data format for cells containing values of the specified field type.
fieldType - the field type to set the data format fordataFormat - the Excel data format string (e.g. "m/d/yy" for dates, "0.00" for decimals)setDataFormat(FieldType, String)public ExcelWriter setDataFormat(FieldType fieldType, String dataFormat)
fieldType - the field type to set the data format fordataFormat - the Excel data format string (e.g. "m/d/yy" for dates, "0.00" for decimals)FieldTypepublic ExcelWriter addHeaderHyperlink(FieldLocationPredicate predicate, ExcelHyperlinkFunction function)
predicate - the predicate to match header cell locations, or null to apply to all headersfunction - the function that creates hyperlinks based on field locationFieldLocationPredicate,
ExcelHyperlinkFunctionpublic ExcelWriter addHeaderCellStyle(FieldLocationPredicate predicate, ExcelCellStyleDecorator decorator)
predicate - the predicate to match header cell locations, or null to apply to all headersdecorator - the decorator that applies cell styles based on field locationFieldLocationPredicate,
ExcelCellStyleDecoratorprotected void addHeaderMetadata(Record record) throws Throwable
Throwablepublic ExcelWriter addDataHyperlink(FieldLocationPredicate predicate, ExcelHyperlinkFunction function)
predicate - the predicate to match data cell locations, or null to apply to all data cellsfunction - the function that creates hyperlinks based on field locationFieldLocationPredicate,
ExcelHyperlinkFunctionpublic ExcelWriter addDataCellStyle(FieldLocationPredicate predicate, ExcelCellStyleDecorator decorator)
predicate - the predicate to match data cell locations, or null to apply to all data cellsdecorator - the decorator that applies cell styles based on field locationFieldLocationPredicate,
ExcelCellStyleDecoratorCopyright (c) 2006-2026 North Concepts Inc. All Rights Reserved.