public abstract class AbstractTransformer extends Object implements Transformer
Transformer
interface methodsModifier and Type | Field and Description |
---|---|
protected Map<String,SheetData> |
sheetMap |
Constructor and Description |
---|
AbstractTransformer() |
Modifier and Type | Method and Description |
---|---|
void |
addImage(AreaRef areaRef,
byte[] imageBytes,
ImageType imageType,
Double scaleX,
Double scaleY) |
void |
adjustTableSize(CellRef ref,
Size size) |
boolean |
deleteSheet(String sheetName) |
void |
dispose()
Must be called after use.
|
CellData |
getCellData(CellRef cellRef) |
Set<CellData> |
getFormulaCells() |
List<CellRef> |
getTargetCellRef(CellRef cellRef) |
TransformationConfig |
getTransformationConfig() |
boolean |
isEvaluateFormulas()
This property is used to recalculate all formulas before saving the workbook.
|
boolean |
isForwardOnly() |
boolean |
isFullFormulaRecalculationOnOpening() |
boolean |
isIgnoreColumnProps() |
boolean |
isIgnoreRowProps() |
void |
mergeCells(CellRef ref,
int rows,
int cols) |
void |
resetTargetCellRefs() |
void |
setEvaluateFormulas(boolean evaluateFormulas)
This option does not work for streaming.
|
void |
setFullFormulaRecalculationOnOpening(boolean fullFormulaRecalculationOnOpening)
If you set this option to true, all formulas will be recalculated when the file is opened in MS Excel.
|
void |
setIgnoreColumnProps(boolean ignoreColumnProps) |
void |
setIgnoreRowProps(boolean ignoreRowProps) |
void |
setTransformationConfig(TransformationConfig transformationConfig) |
void |
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addImage, clearCell, getCommentedCells, getExceptionHandler, resetArea, setExceptionHandler, setFormula, setHidden, transform, updateRowHeight, write
public List<CellRef> getTargetCellRef(CellRef cellRef)
getTargetCellRef
in interface Transformer
cellRef
- a source cell referencepublic void resetTargetCellRefs()
resetTargetCellRefs
in interface Transformer
public CellData getCellData(CellRef cellRef)
getCellData
in interface Transformer
public boolean isIgnoreColumnProps()
public void setIgnoreColumnProps(boolean ignoreColumnProps)
public boolean isIgnoreRowProps()
public void setIgnoreRowProps(boolean ignoreRowProps)
public TransformationConfig getTransformationConfig()
getTransformationConfig
in interface Transformer
public void setTransformationConfig(TransformationConfig transformationConfig)
setTransformationConfig
in interface Transformer
public Set<CellData> getFormulaCells()
getFormulaCells
in interface Transformer
public boolean deleteSheet(String sheetName)
deleteSheet
in interface Transformer
public void adjustTableSize(CellRef ref, Size size)
adjustTableSize
in interface Transformer
public void dispose()
Transformer
dispose
in interface Transformer
public void mergeCells(CellRef ref, int rows, int cols)
mergeCells
in interface Transformer
public void writeButNotCloseStream() throws IOException
Transformer
writeButNotCloseStream
in interface Transformer
IOException
- -public void addImage(AreaRef areaRef, byte[] imageBytes, ImageType imageType, Double scaleX, Double scaleY)
addImage
in interface Transformer
public boolean isEvaluateFormulas()
Transformer
isEvaluateFormulas
in interface Transformer
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)
public boolean isFullFormulaRecalculationOnOpening()
isFullFormulaRecalculationOnOpening
in interface Transformer
public void setFullFormulaRecalculationOnOpening(boolean fullFormulaRecalculationOnOpening)
Transformer
setFullFormulaRecalculationOnOpening
in interface Transformer
fullFormulaRecalculationOnOpening
- false: do nothing (default value),
true: activate recalculation when openingpublic void setEvaluateFormulas(boolean evaluateFormulas)
setEvaluateFormulas
in interface Transformer
evaluateFormulas
- false: formulas will be evaluated by MS Excel when opening the Excel file;
true (default): evaluate formulas before writing.public boolean isForwardOnly()
isForwardOnly
in interface Transformer
Copyright © 2023. All rights reserved.