Package org.jxls.transform
Interface Transformer
- All Known Implementing Classes:
AbstractTransformer,TransformerDelegator
public interface Transformer
Defines interface methods for Excel operations
- Author:
- Leonid Vysochyn
-
Method Summary
Modifier and TypeMethodDescriptionvoidadjustTableSize(CellRef ref, Size size) voidbooleandeleteSheet(String sheetName) voiddispose()Must be called after use.getCellData(CellRef cellRef) getTargetCellRef(CellRef cellRef) booleanThis property is used to recalculate all formulas before saving the workbook.booleanbooleanvoidvoidvoidsetEvaluateFormulas(boolean evaluateFormulas) This property is used to recalculate all formulas before saving the workbook.voidsetFormula(CellRef cellRef, String formulaString) voidsetFullFormulaRecalculationOnOpening(boolean fullFormulaRecalculationOnOpening) If you set this option to true, all formulas will be recalculated when the file is opened in MS Excel.voidvoidsetIgnoreColumnProps(boolean ignoreColumnProps) voidsetIgnoreRowProps(boolean ignoreRowProps) voidsetLogger(JxlsLogger logger) voidsetOutputStream(OutputStream outputStream) voidvoidupdateRowHeight(String srcSheetName, int srcRowNum, String targetSheetName, int targetRowNum) voidwrite()Writes Excel workbook to output stream and disposes the workbook.voidWrites Excel workbook to output stream but not close the stream designed to use with ZipOutputStream or other OutputStream for creates several xls files one time.
-
Method Details
-
transform
-
setOutputStream
-
writeButNotCloseStream
Writes Excel workbook to output stream but not close the stream designed to use with ZipOutputStream or other OutputStream for creates several xls files one time.- Throws:
IOException- -
-
write
Writes Excel workbook to output stream and disposes the workbook.- Throws:
IOException- -
-
dispose
void dispose()Must be called after use. write() calls this method. -
setFormula
-
getFormulaCells
-
getCellData
-
getTargetCellRef
- Parameters:
cellRef- a source cell reference- Returns:
- a list of cell references into which the source cell was transformed
-
resetTargetCellRefs
void resetTargetCellRefs() -
resetArea
-
clearCell
-
getCommentedCells
-
deleteSheet
-
setHidden
-
updateRowHeight
-
adjustTableSize
-
isEvaluateFormulas
boolean isEvaluateFormulas()This property is used to recalculate all formulas before saving the workbook. This property is set to true if you don't open the file with MS Excel and just read it (e.g. with a unit test). The following documentation is POI specific.- Returns:
- true: calls
workbook.getCreationHelper().createFormulaEvaluator().evaluateAll()before writing the workbook. Please have a look at the POI documentation for more details. This does not work for streaming. Please be aware that POI supports only a subset of Excel formulas. If an unsupported formula is in the template the evaluation will fail.false (default): do nothing (hopefully MS Excel will recalculate all formulas while opening the file)
-
setEvaluateFormulas
void setEvaluateFormulas(boolean evaluateFormulas) This property is used to recalculate all formulas before saving the workbook. This property is set to true if you don't open the file with MS Excel and just read it (e.g. with a unit test). The following documentation is POI specific.- Parameters:
evaluateFormulas- true: callsworkbook.getCreationHelper().createFormulaEvaluator().evaluateAll()before writing the workbook. Please have a look at the POI documentation for more details. This does not work for streaming. Please be aware that POI supports only a subset of Excel formulas. If an unsupported formula is in the template the evaluation will fail.false (default): do nothing (hopefully MS Excel will recalculate all formulas while opening the file)
-
isFullFormulaRecalculationOnOpening
boolean isFullFormulaRecalculationOnOpening()- Returns:
- false: do nothing, true: activate recalculation when opening
-
setFullFormulaRecalculationOnOpening
void setFullFormulaRecalculationOnOpening(boolean fullFormulaRecalculationOnOpening) If you set this option to true, all formulas will be recalculated when the file is opened in MS Excel. This changes the Excel file. This only works once.- Parameters:
fullFormulaRecalculationOnOpening- false: do nothing (default value), true: activate recalculation when opening
-
isForwardOnly
boolean isForwardOnly()- Returns:
- true if the transformer can process cells only in a single pass
-
getLogger
JxlsLogger getLogger()- Returns:
- never null
-
setLogger
- Parameters:
logger- not null
-
setIgnoreColumnProps
void setIgnoreColumnProps(boolean ignoreColumnProps) -
setIgnoreRowProps
void setIgnoreRowProps(boolean ignoreRowProps)
-