java.lang.Object
com.aspose.cells.Cell
public class Cell
Example:
Workbook excel = new Workbook();
Cells cells = excel.getWorksheets().get(0).getCells();
//Put a string into a cell
Cell cell = cells.get(0, 0);
cell.putValue("Hello");
String first = cell.getStringValue();
//Put an integer into a cell
cell = cells.get("B1");
cell.putValue(12);
int second = cell.getIntValue();
//Put a double into a cell
cell = cells.get(0, 2);
cell.putValue(-1.234);
double third = cell.getDoubleValue();
//Put a formula into a cell
cell = cells.get("D1");
cell.setFormula("=B1 + C1");
//Put a combined formula: "sum(average(b1,c1), b1)" to cell at b2
cell = cells.get("b2");
cell.setFormula("=sum(average(b1,c1), b1)");
//Set style of a cell
Style style = cell.getStyle();
//Set background color
style.setBackgroundColor(Color.getYellow());
//Set format of a cell
style.getFont().setName("Courier New");
style.setVerticalAlignment(TextAlignmentType.TOP);
cell.setStyle(style);
| Property Getters/Setters Summary | ||
|---|---|---|
boolean | getBoolValue() | |
| Gets the boolean value contained in the cell. | ||
int | getColumn() | |
| Gets column number (zero based) of the cell. | ||
Comment | getComment() | |
| Gets the comment of this cell. | ||
boolean | containsExternalLink() | |
| Indicates whether this cell contains an external link. Only applies when the cell is a formula cell. | ||
com.aspose.cells.DateTime | getDateTimeValue() | |
| Gets the DateTime value contained in the cell. | ||
java.lang.String | getDisplayStringValue() | |
| Gets the formatted string value of this cell by cell's display style. | ||
double | getDoubleValue() | |
| Gets the double value contained in the cell. | ||
float | getFloatValue() | |
| Gets the float value contained in the cell. | ||
java.lang.String | getFormula() | |
void | setFormula(java.lang.String) | |
|
Gets or sets a formula of the |
||
java.lang.String | getFormulaLocal() | |
void | setFormulaLocal(java.lang.String) | |
| Get the locale formatted formula of the cell. | ||
boolean | hasCustomStyle() | |
| Indicates whether this cell has custom style settings(different from the default one inherited from corresponding row, column, or workbook). | ||
java.lang.String | getHtmlString() | |
void | setHtmlString(java.lang.String) | |
| Gets and sets the html string which contains data and some formats in this cell. | ||
int | getIntValue() | |
| Gets the integer value contained in the cell. | ||
boolean | isArrayFormula() | |
| Indicates whether the cell formula is an array formula. | ||
boolean | isArrayHeader() | |
| Indicates the cell's formula is and array formula and it is the first cell of the array. | ||
boolean | isDynamicArrayFormula() | |
| Indicates whether the cell's formula is dynamic array formula(true) or legacy array formula(false). | ||
boolean | isErrorValue() | |
| Checks if the value of this cell is an error. | ||
boolean | isFormula() | |
| Represents if the specified cell contains formula. | ||
boolean | isInArray() | |
| Indicates whether the cell formula is an array formula. | ||
boolean | isInTable() | |
| Indicates whether this cell is part of table formula. | ||
boolean | isMerged() | |
| Checks if a cell is part of a merged range or not. | ||
boolean | isNumericValue() | |
| Indicates whether the inner value of this cell is numeric(int, double and datetime) | ||
boolean | isSharedFormula() | |
| Indicates whether the cell formula is part of shared formula. | ||
boolean | isStyleSet() | |
| Indicates if the cell's style is set. If return false, it means this cell has a default cell format. | ||
boolean | isTableFormula() | |
| Indicates whether this cell is part of table formula. | ||
java.lang.String | getName() | |
| Gets the name of the cell. | ||
int | getNumberCategoryType() | |
| Represents the category type of this cell's number formatting. The value of the property is NumberCategoryType integer constant. | ||
java.lang.String | getR1C1Formula() | |
void | setR1C1Formula(java.lang.String) | |
|
Gets or sets a R1C1 formula of the |
||
int | getRow() | |
| Gets row number (zero based) of the cell. | ||
int | getSharedStyleIndex() | |
| Gets cell's shared style index in the style pool. | ||
java.lang.String | getStringValue() | |
| Gets the string value contained in the cell. If the type of this cell is string, then return the string value itself. For other cell types, the formatted string value (formatted with the specified style of this cell) will be returned. The formatted cell value is same with what you can get from excel when copying a cell as text(such as copying cell to text editor or exporting to csv). | ||
java.lang.String | getStringValueWithoutFormat() | |
| Gets cell's value as string without any format. | ||
int | getType() | |
| Represents cell value type. The value of the property is CellValueType integer constant. | ||
java.lang.Object | getValue() | |
void | setValue(java.lang.Object) | |
| Gets the value contained in this cell. | ||
Worksheet | getWorksheet() | |
| Gets the parent worksheet. | ||
| Method Summary | ||
|---|---|---|
void | calculate(boolean ignoreError, ICustomFunction customFunction) | |
| Calculates the formula of the cell. | ||
void | calculate(CalculationOptions options) | |
| Calculates the formula of the cell. | ||
FontSetting | characters(int startIndex, int length) | |
| Returns a Characters object that represents a range of characters within the cell text. | ||
void | copy(Cell cell) | |
| Copies data from a source cell. | ||
boolean | equals(Cell cell) | |
| Checks whether this object refers to the same cell with another cell object. | ||
boolean | equals(java.lang.Object obj) | |
| Checks whether this object refers to the same cell with another. | ||
CellArea | getArrayRange() | |
| Gets the array range if the cell's formula is an array formula. | ||
com.aspose.cells.FontSetting[] | getCharacters() | |
| Returns all Characters objects that represents a range of characters within the cell text. | ||
com.aspose.cells.FontSetting[] | getCharacters(boolean flag) | |
| Returns all Characters objects that represents a range of characters within the cell text. | ||
ConditionalFormattingResult | getConditionalFormattingResult() | |
| Get the result of the conditional formatting. | ||
com.aspose.cells.Cell[] | getDependents(boolean isAll) | |
| Get all cells whose formula references to this cell directly. | ||
java.util.Iterator | getDependentsInCalculation(boolean recursive) | |
| Gets all cells whose calculated result depends on this cell. | ||
Style | getDisplayStyle() | |
| Gets the display style of the cell. If this cell is also affected by other settings such as conditional formatting, list objects, etc., then the display style may be different from cell.GetStyle(). | ||
Style | getDisplayStyle(boolean includeMergedBorders) | |
| Gets the display style of the cell. If the cell is conditional formatted, the display style is not same as the cell.GetStyle(). | ||
com.aspose.cells.FormatConditionCollection[] | getFormatConditions() | |
| Gets format conditions which applies to this cell. | ||
java.lang.String | getFormula(boolean isR1C1, boolean isLocal) | |
| Get the formula of this cell. | ||
int | getHeightOfValue() | |
| Gets the height of the value in unit of pixels. | ||
java.lang.String | getHtmlString(boolean html5) | |
| Gets the html string which contains data and some formats in this cell. | ||
java.util.Iterator | getLeafs() | |
| Get all cells which reference to this cell directly and need to be updated when this cell is modified. | ||
java.util.Iterator | getLeafs(boolean recursive) | |
| Get all cells which will be updated when this cell is modified. | ||
Range | getMergedRange() | |
|
Returns a |
||
ReferredAreaCollection | getPrecedents() | |
| Gets all references appearing in this cell's formula. | ||
java.util.Iterator | getPrecedentsInCalculation() | |
| Gets all precedents(reference to cells in current workbook) used by this cell's formula while calculating it. | ||
java.lang.String | getStringValue(int formatStrategy) | |
| Gets the string value by specific formatted strategy. | ||
Style | getStyle() | |
| Gets the cell style. | ||
Style | getStyle(boolean checkBorders) | |
| If checkBorders is true, check whether other cells' borders will effect the style of this cell. | ||
ListObject | getTable() | |
| Gets the table which contains this cell. | ||
Validation | getValidation() | |
| Gets the validation applied to this cell. | ||
boolean | getValidationValue() | |
| Gets the value of validation which applied to this cell. | ||
int | getWidthOfValue() | |
| Gets the width of the value in unit of pixels. | ||
int | hashCode() | |
| Serves as a hash function for a particular type. | ||
boolean | isRichText() | |
| Indicates whether the cell string value is a rich text. | ||
void | putValue(boolean boolValue) | |
| Puts a boolean value into the cell. | ||
void | putValue(com.aspose.cells.DateTime dateTime) | |
| Puts a DateTime value into the cell. | ||
void | putValue(double doubleValue) | |
| Puts a double value into the cell. | ||
void | putValue(int intValue) | |
| Puts an integer value into the cell. | ||
void | putValue(java.lang.Object objectValue) | |
| Puts an object value into the cell. | ||
void | putValue(java.lang.String stringValue) | |
| Puts a string value into the cell. | ||
void | putValue(java.lang.String stringValue, boolean isConverted) | |
| Puts a string value into the cell and converts the value to other data type if appropriate. | ||
void | putValue(java.lang.String stringValue, boolean isConverted, boolean setStyle) | |
| Puts a value into the cell, if appropriate the value will be converted to other data type and cell's number format will be reset. | ||
void | removeArrayFormula(boolean leaveNormalFormula) | |
| Remove array formula. | ||
void | setArrayFormula(java.lang.String arrayFormula, int rowNumber, int columnNumber) | |
| Sets an array formula(legacy array formula entered via CTRL+SHIFT+ENTER in ms excel) to a range of cells. | ||
void | setArrayFormula(java.lang.String arrayFormula, int rowNumber, int columnNumber, boolean isR1C1, boolean isLocal) | |
| Sets an array formula to a range of cells. | ||
void | setArrayFormula(java.lang.String arrayFormula, int rowNumber, int columnNumber, FormulaParseOptions options) | |
| Sets an array formula to a range of cells. | ||
void | setArrayFormula(java.lang.String arrayFormula, int rowNumber, int columnNumber, FormulaParseOptions options, java.lang.Object[][] values) | |
| Sets an array formula to a range of cells. | ||
void | setCharacters(com.aspose.cells.FontSetting[] characters) | |
| Sets rich text format of the cell. | ||
CellArea | setDynamicArrayFormula(java.lang.String arrayFormula, FormulaParseOptions options, boolean calculateValue) | |
| Sets dynamic array formula and make the formula spill into neighboring cells if possible. | ||
CellArea | setDynamicArrayFormula(java.lang.String arrayFormula, FormulaParseOptions options, java.lang.Object[][] values, boolean calculateRange, boolean calculateValue) | |
| Sets dynamic array formula and make the formula spill into neighboring cells if possible. | ||
CellArea | setDynamicArrayFormula(java.lang.String arrayFormula, FormulaParseOptions options, java.lang.Object[][] values, boolean calculateRange, boolean calculateValue, CalculationOptions copts) | |
| Sets dynamic array formula and make the formula spill into neighboring cells if possible. | ||
void | setFormula(java.lang.String formula, boolean isR1C1, boolean isLocal, java.lang.Object value) | |
| Set the formula and the value of the formula. | ||
void | setFormula(java.lang.String formula, FormulaParseOptions options, java.lang.Object value) | |
| Set the formula and the value of the formula. | ||
void | setFormula(java.lang.String formula, java.lang.Object value) | |
| Set the formula and the value of the formula. | ||
void | setSharedFormula(java.lang.String sharedFormula, int rowNumber, int columnNumber) | |
| Sets shared formulas to a range of cells. | ||
void | setSharedFormula(java.lang.String sharedFormula, int rowNumber, int columnNumber, boolean isR1C1, boolean isLocal) | |
| Sets a formula to a range of cells. | ||
void | setSharedFormula(java.lang.String sharedFormula, int rowNumber, int columnNumber, FormulaParseOptions options) | |
| Sets shared formulas to a range of cells. | ||
void | setSharedFormula(java.lang.String sharedFormula, int rowNumber, int columnNumber, FormulaParseOptions options, java.lang.Object[][] values) | |
| Sets shared formulas to a range of cells. | ||
void | setStyle(Style style) | |
| Sets the cell style. | ||
void | setStyle(Style style, boolean explicitFlag) | |
| Apply the cell style. | ||
void | setStyle(Style style, StyleFlag flag) | |
| Apply the cell style. | ||
void | setTableFormula(int rowNumber, int columnNumber, int rowIndexOfInputCell, int columnIndexOfInputCell, boolean isRowInput, java.lang.Object[][] values) | |
| Create one-variable data table for given range starting from this cell. | ||
void | setTableFormula(int rowNumber, int columnNumber, int rowIndexOfRowInputCell, int columnIndexOfRowInputCell, int rowIndexOfColumnInputCell, int columnIndexOfColumnInputCell, java.lang.Object[][] values) | |
| Create two-variable data table for given range starting from this cell. | ||
void | setTableFormula(int rowNumber, int columnNumber, java.lang.String inputCell, boolean isRowInput, java.lang.Object[][] values) | |
| Create one-variable data table for given range starting from this cell. | ||
void | setTableFormula(int rowNumber, int columnNumber, java.lang.String rowInputCell, java.lang.String columnInputCell, java.lang.Object[][] values) | |
| Create two-variable data table for given range starting from this cell. | ||
java.lang.String | toJson() | |
|
Convert |
||
java.lang.String | toString() | |
| Returns a string represents the current Cell object. | ||
| Property Getters/Setters Detail |
|---|
getWorksheet | |
public Worksheet getWorksheet() | |
getDateTimeValue | |
public com.aspose.cells.DateTime getDateTimeValue() | |
getRow | |
public int getRow() | |
getColumn | |
public int getColumn() | |
isFormula | |
public boolean isFormula() | |
getType | |
public int getType() | |
getName | |
public java.lang.String getName() | |
isErrorValue | |
public boolean isErrorValue() | |
isNumericValue | |
public boolean isNumericValue() | |
getStringValue | |
public java.lang.String getStringValue() | |
getStringValueWithoutFormat | |
public java.lang.String getStringValueWithoutFormat() | |
getNumberCategoryType | |
public int getNumberCategoryType() | |
getDisplayStringValue | |
public java.lang.String getDisplayStringValue() | |
getIntValue | |
public int getIntValue() | |
getDoubleValue | |
public double getDoubleValue() | |
getFloatValue | |
public float getFloatValue() | |
getBoolValue | |
public boolean getBoolValue() | |
hasCustomStyle | |
public boolean hasCustomStyle() | |
getSharedStyleIndex | |
public int getSharedStyleIndex() | |
getFormula/setFormula | |
public java.lang.String getFormula() / public void setFormula(java.lang.String value) | |
Example:
Workbook excel = new Workbook();
Cells cells = excel.getWorksheets().get(0).getCells();
cells.get("B6").setFormula("=SUM(B2:B5, E1) + sheet1!A1");getFormulaLocal/setFormulaLocal | |
public java.lang.String getFormulaLocal() / public void setFormulaLocal(java.lang.String value) | |
getR1C1Formula/setR1C1Formula | |
public java.lang.String getR1C1Formula() / public void setR1C1Formula(java.lang.String value) | |
containsExternalLink | |
public boolean containsExternalLink() | |
isArrayHeader | |
public boolean isArrayHeader() | |
isDynamicArrayFormula | |
public boolean isDynamicArrayFormula() | |
isArrayFormula | |
public boolean isArrayFormula() | |
isInArray | |
public boolean isInArray() | |
isSharedFormula | |
public boolean isSharedFormula() | |
isTableFormula | |
public boolean isTableFormula() | |
isInTable | |
public boolean isInTable() | |
getValue/setValue | |
public java.lang.Object getValue() / public void setValue(java.lang.Object value) | |
null,
Boolean,
DateTime,
Double,
Integer
String.
For int value, it may be returned as an Integer object or a Double object. And there is no guarantee that the returned value will be kept as the same type of object always.isStyleSet | |
public boolean isStyleSet() | |
isMerged | |
public boolean isMerged() | |
getComment | |
public Comment getComment() | |
getHtmlString/setHtmlString | |
public java.lang.String getHtmlString() / public void setHtmlString(java.lang.String value) | |
| Method Detail |
|---|
setDynamicArrayFormula | |
public CellArea setDynamicArrayFormula(java.lang.String arrayFormula, FormulaParseOptions options, boolean calculateValue) | |
arrayFormula - the formula expressionoptions - options to parse formula.
"Parse" option will be ignored and the formula will always be parsed immediatelycalculateValue - whether calculate this dynamic array formula for those cells in the spilled range.setDynamicArrayFormula | |
public CellArea setDynamicArrayFormula(java.lang.String arrayFormula, FormulaParseOptions options, java.lang.Object[][] values, boolean calculateRange, boolean calculateValue) | |
arrayFormula - the formula expressionoptions - options to parse formula.
"Parse" option will be ignored and the formula will always be parsed immediatelyvalues - values for those cells with given dynamic array formulacalculateRange -
Whether calculate the spilled range for this dynamic array formula.
If the "values" parameter is not null and this flag is false,
then the spilled range's height will be values.Length and width will be values[0].Length.
calculateValue -
whether calculate this dynamic array formula for those cells in the spilled range when "values" is null
or corresponding item in "values" for one cell is null.
setDynamicArrayFormula | |
public CellArea setDynamicArrayFormula(java.lang.String arrayFormula, FormulaParseOptions options, java.lang.Object[][] values, boolean calculateRange, boolean calculateValue, CalculationOptions copts) | |
arrayFormula - the formula expressionoptions - options to parse formula.
"Parse" option will be ignored and the formula will always be parsed immediatelyvalues - values for those cells with given dynamic array formulacalculateRange -
Whether calculate the spilled range for this dynamic array formula.
If the "values" parameter is not null and this flag is false,
then the spilled range's height will be values.Length and width will be values[0].Length.
calculateValue -
whether calculate this dynamic array formula for those cells in the spilled range when "values" is null
or corresponding item in "values" for one cell is null.
copts - The options for calculating formula.
Commonly, for performance consideration, the setTableFormula | |
public void setTableFormula(int rowNumber, int columnNumber, java.lang.String rowInputCell, java.lang.String columnInputCell, java.lang.Object[][] values) | |
rowNumber - Number of rows to populate the formula.columnNumber - Number of columns to populate the formula.rowInputCell - the row input cellcolumnInputCell - the column input cellvalues - values for cells in table formula rangesetTableFormula | |
public void setTableFormula(int rowNumber, int columnNumber, java.lang.String inputCell, boolean isRowInput, java.lang.Object[][] values) | |
rowNumber - Number of rows to populate the formula.columnNumber - Number of columns to populate the formula.inputCell - the input cellisRowInput - Indicates whether the input cell is a row input cell(true) or a column input cell(false).values - values for cells in table formula rangesetTableFormula | |
public void setTableFormula(int rowNumber, int columnNumber, int rowIndexOfRowInputCell, int columnIndexOfRowInputCell, int rowIndexOfColumnInputCell, int columnIndexOfColumnInputCell, java.lang.Object[][] values) | |
rowNumber - Number of rows to populate the formula.columnNumber - Number of columns to populate the formula.rowIndexOfRowInputCell - row index of the row input cellcolumnIndexOfRowInputCell - column index of the row input cellrowIndexOfColumnInputCell - row index of the column input cellcolumnIndexOfColumnInputCell - column index of the column input cellvalues - values for cells in table formula rangesetTableFormula | |
public void setTableFormula(int rowNumber, int columnNumber, int rowIndexOfInputCell, int columnIndexOfInputCell, boolean isRowInput, java.lang.Object[][] values) | |
rowNumber - Number of rows to populate the formula.columnNumber - Number of columns to populate the formula.rowIndexOfInputCell - row index of the input cellcolumnIndexOfInputCell - column index of the input cellisRowInput - Indicates whether the input cell is a row input cell(true) or a column input cell(false).values - values for cells in table formula rangeremoveArrayFormula | |
public void removeArrayFormula(boolean leaveNormalFormula) | |
leaveNormalFormula - True represents converting the array formula to normal formula.copy | |
public void copy(Cell cell) | |
cell - Source characters | |
public FontSetting characters(int startIndex, int length) | |
startIndex - The index of the start of the character.length - The number of characters.Example:
Workbook excel = new Workbook();
Cells cells = excel.getWorksheets().get(0).getCells();
cells.get("A1").putValue("Helloworld");
cells.get("A1").characters(5, 5).getFont().setBold(true);
cells.get("A1").characters(5, 5).getFont().setColor(Color.getBlue());isRichText | |
public boolean isRichText() | |
getCharacters | |
public com.aspose.cells.FontSetting[] getCharacters() | |
getCharacters | |
public com.aspose.cells.FontSetting[] getCharacters(boolean flag) | |
flag - Indicates whether applying table style to the cell if the cell is in the table.setCharacters | |
public void setCharacters(com.aspose.cells.FontSetting[] characters) | |
characters - All Characters objects.getMergedRange | |
public Range getMergedRange() | |
getHtmlString | |
public java.lang.String getHtmlString(boolean html5)
throws java.lang.Exception | |
html5 - Indicates whether the value is compatible for html5toString | |
public java.lang.String toString() | |
toJson | |
public java.lang.String toJson()
throws java.lang.Exception | |
equals | |
public boolean equals(java.lang.Object obj) | |
obj - another objecthashCode | |
public int hashCode() | |
equals | |
public boolean equals(Cell cell) | |
cell - another cell objectgetConditionalFormattingResult | |
public ConditionalFormattingResult getConditionalFormattingResult() | |
getValidation | |
public Validation getValidation() | |
getValidationValue | |
public boolean getValidationValue() | |
getTable | |
public ListObject getTable() | |
calculate | |
public void calculate(CalculationOptions options) | |
options - Options for calculationcalculate | |
public void calculate(boolean ignoreError, ICustomFunction customFunction) | |
ignoreError - Indicates if hide the error in calculating formulas.
The error may be unsupported function, external links, etc.customFunction - The custom formula calculation functions to extend the calculation engine.putValue | |
public void putValue(boolean boolValue) | |
boolValue - putValue | |
public void putValue(int intValue) | |
intValue - Input valueputValue | |
public void putValue(double doubleValue) | |
doubleValue - Input valueputValue | |
public void putValue(java.lang.String stringValue, boolean isConverted, boolean setStyle) | |
stringValue - Input valueisConverted - True: converted to other data type if appropriate.setStyle - True: set the number format to cell's style when converting to other data typeputValue | |
public void putValue(java.lang.String stringValue, boolean isConverted) | |
stringValue - Input valueisConverted - True: converted to other data type if appropriate.putValue | |
public void putValue(java.lang.String stringValue) | |
stringValue - Input valueputValue | |
public void putValue(com.aspose.cells.DateTime dateTime) | |
dateTime - Input valueputValue | |
public void putValue(java.lang.Object objectValue) | |
objectValue - input valuegetStringValue | |
public java.lang.String getStringValue(int formatStrategy) | |
formatStrategy - A getWidthOfValue | |
public int getWidthOfValue()
throws java.lang.Exception | |
getHeightOfValue | |
public int getHeightOfValue()
throws java.lang.Exception | |
getDisplayStyle | |
public Style getDisplayStyle() | |
getDisplayStyle | |
public Style getDisplayStyle(boolean includeMergedBorders) | |
includeMergedBorders - Indicates whether checking borders of the merged cells.
getFormatConditions | |
public com.aspose.cells.FormatConditionCollection[] getFormatConditions() | |
getStyle | |
public Style getStyle() | |
getStyle | |
public Style getStyle(boolean checkBorders) | |
checkBorders - Check other cells' borderssetStyle | |
public void setStyle(Style style) | |
style - The cell style.setStyle | |
public void setStyle(Style style, boolean explicitFlag) | |
style - The cell style.explicitFlag - True, only overwriting formatting which is explicitly set.
setStyle | |
public void setStyle(Style style, StyleFlag flag) | |
style - The cell style.flag - The style flag.setFormula | |
public void setFormula(java.lang.String formula, java.lang.Object value) | |
formula - The formula.value - The value of the formula.getFormula | |
public java.lang.String getFormula(boolean isR1C1, boolean isLocal) | |
isR1C1 - Whether the formula needs to be formatted as R1C1.isLocal - Whether the formula needs to be formatted by locale.setFormula | |
public void setFormula(java.lang.String formula, boolean isR1C1, boolean isLocal, java.lang.Object value) | |
formula - The formula.isR1C1 - Whether the formula is R1C1 formula.isLocal - Whether the formula is locale formatted.value - The value of the formula.setFormula | |
public void setFormula(java.lang.String formula, FormulaParseOptions options, java.lang.Object value) | |
formula - The formula.options - Options for parsing the formula.value - The value of the formula.setArrayFormula | |
public void setArrayFormula(java.lang.String arrayFormula, int rowNumber, int columnNumber, boolean isR1C1, boolean isLocal) | |
arrayFormula - Array formula.rowNumber - Number of rows to populate result of the array formula.columnNumber - Number of columns to populate result of the array formula.isR1C1 - whether the formula is R1C1 formulaisLocal - whether the formula is locale formattedsetArrayFormula | |
public void setArrayFormula(java.lang.String arrayFormula, int rowNumber, int columnNumber) | |
arrayFormula - Array formula.rowNumber - Number of rows to populate result of the array formula.columnNumber - Number of columns to populate result of the array formula.setArrayFormula | |
public void setArrayFormula(java.lang.String arrayFormula, int rowNumber, int columnNumber, FormulaParseOptions options) | |
arrayFormula - Array formula.rowNumber - Number of rows to populate result of the array formula.columnNumber - Number of columns to populate result of the array formula.options - Options for parsing the formula.setArrayFormula | |
public void setArrayFormula(java.lang.String arrayFormula, int rowNumber, int columnNumber, FormulaParseOptions options, java.lang.Object[][] values) | |
arrayFormula - Array formula.rowNumber - Number of rows to populate result of the array formula.columnNumber - Number of columns to populate result of the array formula.options - Options for parsing the formula.values - values for those cells with given array formulasetSharedFormula | |
public void setSharedFormula(java.lang.String sharedFormula, int rowNumber, int columnNumber, boolean isR1C1, boolean isLocal) | |
sharedFormula - Shared formula.rowNumber - Number of rows to populate the formula.columnNumber - Number of columns to populate the formula.isR1C1 - whether the formula is R1C1 formulaisLocal - whether the formula is locale formattedsetSharedFormula | |
public void setSharedFormula(java.lang.String sharedFormula, int rowNumber, int columnNumber) | |
sharedFormula - Shared formula.rowNumber - Number of rows to populate the formula.columnNumber - Number of columns to populate the formula.setSharedFormula | |
public void setSharedFormula(java.lang.String sharedFormula, int rowNumber, int columnNumber, FormulaParseOptions options) | |
sharedFormula - Shared formula.rowNumber - Number of rows to populate the formula.columnNumber - Number of columns to populate the formula.options - Options for parsing the formula.setSharedFormula | |
public void setSharedFormula(java.lang.String sharedFormula, int rowNumber, int columnNumber, FormulaParseOptions options, java.lang.Object[][] values) | |
sharedFormula - Shared formula.rowNumber - Number of rows to populate the formula.columnNumber - Number of columns to populate the formula.options - Options for parsing the formula.values - values for those cells with given shared formulagetPrecedents | |
public ReferredAreaCollection getPrecedents() | |
Example:
Workbook workbook = new Workbook();
Cells cells = workbook.getWorksheets().get(0).getCells();
cells.get("A1").setFormula("=B1+SUM(B1:B10)+[Book1.xls]Sheet1!A1");
ReferredAreaCollection areas = cells.get("A1").getPrecedents();
for (int i = 0; i < areas.getCount(); i++)
{
ReferredArea area = areas.get(i);
StringBuilder stringBuilder = new StringBuilder();
if (area.isExternalLink())
{
stringBuilder.append("[");
stringBuilder.append(area.getExternalFileName());
stringBuilder.append("]");
}
stringBuilder.append(area.getSheetName());
stringBuilder.append("!");
stringBuilder.append(CellsHelper.cellIndexToName(area.getStartRow(), area.getStartColumn()));
if (area.isArea())
{
stringBuilder.append(":");
stringBuilder.append(CellsHelper.cellIndexToName(area.getEndRow(), area.getEndColumn()));
}
System.out.println(stringBuilder.toString());
}getDependents | |
public com.aspose.cells.Cell[] getDependents(boolean isAll) | |
isAll - Indicates whether check formulas in other worksheetsExample:
Workbook workbook = new Workbook();
Cells cells = workbook.getWorksheets().get(0).getCells();
cells.get("A1").setFormula("=B1+SUM(B1:B10)+[Book1.xls]Sheet1!B2");
cells.get("A2").setFormula("=IF(TRUE,B2,B1)");
Cell[] dependents = cells.get("B1").getDependents(true);
for (int i = 0; i < dependents.length; i++)
{
System.out.println(dependents[i].getName());
}getPrecedentsInCalculation | |
public java.util.Iterator getPrecedentsInCalculation() | |
Example:
Workbook workbook = new Workbook();
Cells cells = workbook.getWorksheets().get(0).getCells();
cells.get("A2").setFormula("=IF(TRUE,B2,B1)");
workbook.getSettings().getFormulaSettings().setEnableCalculationChain(true);
workbook.calculateFormula();
Iterator en = cells.get("A2").getPrecedentsInCalculation();
System.out.println("A2's calculation precedents:");
while(en.hasNext())
{
ReferredArea r = (ReferredArea)en.next();
System.out.println(r);
}getDependentsInCalculation | |
public java.util.Iterator getDependentsInCalculation(boolean recursive) | |
recursive - Whether returns those dependents which do not reference to this cell directly
but reference to other leafs of this cell Example:
Workbook workbook = new Workbook();
Cells cells = workbook.getWorksheets().get(0).getCells();
cells.get("A1").setFormula("=B1+SUM(B1:B10)+[Book1.xls]Sheet1!B2");
cells.get("A2").setFormula("=IF(TRUE,B2,B1)");
workbook.getSettings().getFormulaSettings().setEnableCalculationChain(true);
workbook.calculateFormula();
Iterator en = cells.get("B1").getDependentsInCalculation(false);
System.out.println("B1's calculation dependents:");
while(en.hasNext())
{
Cell c = (Cell)en.next();
System.out.println(c.getName());
}
en = cells.get("B2").getDependentsInCalculation(false);
System.out.println("B2's calculation dependents:");
while(en.hasNext())
{
Cell c = (Cell)en.next();
System.out.println(c.getName());
}getLeafs | |
public java.util.Iterator getLeafs() | |
getLeafs | |
public java.util.Iterator getLeafs(boolean recursive) | |
recursive - Whether returns those leafs that do not reference to this cell directly
but reference to other leafs of this cellgetArrayRange | |
public CellArea getArrayRange() | |