aspose.cells

Class Cell

Encapsulates the object that represents a single Workbook cell.

Example:

$workbook = new cells\Workbook();
$cells = $workbook->getWorksheets()->get(0)->getCells();

//Put a string into a cell
$cell =$cells->get(0, 0);
$cell->putValue("Hello");
$first = $cell->getStringValue();
//Put an integer into a cell
$cell =$cells->get("B1");
$cell->putValue(12);
$second = $cell->getIntValue();
//Put a double into a cell
$cell =$cells->get(0, 2);
$cell->putValue(-1.234);
$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 = $cell->getStyle();
//Set background color
$style->setBackgroundColor(cells\Color::getYellow());
//Set format of a cell
$style->getFont()->setName("Courier New");
$style->setVerticalAlignment(cells\TextAlignmentType::TOP);
$cell->setStyle($style);

Property Getters/Setters Summary
functiongetBoolValue()
Gets the boolean value contained in the cell.
functiongetColumn()
Gets column number (zero based) of the cell.
functiongetComment()
Gets the comment of this cell.
functioncontainsExternalLink()
Indicates whether this cell contains an external link. Only applies when the cell is a formula cell.
functiongetDateTimeValue()
Gets the DateTime value contained in the cell.
functiongetDisplayStringValue()
Gets the formatted string value of this cell by cell's display style.
functiongetDoubleValue()
Gets the double value contained in the cell.
functiongetEmbeddedImage()
function
           Gets and sets the embeddedn image in the cell.
functiongetFloatValue()
Gets the float value contained in the cell.
functiongetFormula()
function
setFormula(value)
           Gets or sets a formula of the Cell.
functiongetFormulaLocal()
function
           Get the locale formatted formula of the cell.
functionhasCustomStyle()
Indicates whether this cell has custom style settings(different from the default one inherited from corresponding row, column, or workbook).
functiongetHtmlString()
function
           Gets and sets the html string which contains data and some formats in this cell.
functiongetIntValue()
Gets the integer value contained in the cell.
functionisArrayFormula()
Indicates whether the cell formula is an array formula.
functionisArrayHeader()
Indicates the cell's formula is an array formula and it is the first cell of the array.
functionisDynamicArrayFormula()
Indicates whether the cell's formula is dynamic array formula(true) or legacy array formula(false).
functionisErrorValue()
Checks if the value of this cell is an error.
functionisFormula()
Represents if the specified cell contains formula.
functionisInArray()
Indicates whether the cell formula is an array formula.
functionisInTable()
Indicates whether this cell is part of table formula.
functionisMerged()
Checks if a cell is part of a merged range or not.
functionisNumericValue()
Indicates whether the value of this cell is numeric(int, double and datetime)
functionisSharedFormula()
Indicates whether the cell formula is part of shared formula.
functionisStyleSet()
Indicates if the cell's style is set. If return false, it means this cell has a default cell format.
functionisTableFormula()
Indicates whether this cell is part of table formula.
functiongetName()
Gets the name of the cell.
functiongetNumberCategoryType()
Represents the category type of this cell's number formatting. The value of the property is NumberCategoryType integer constant.
functiongetR1C1Formula()
function
           Gets or sets a R1C1 formula of the Cell.
functiongetRow()
Gets row number (zero based) of the cell.
functiongetSharedStyleIndex()
Gets cell's shared style index in the style pool.
functiongetStringValue()
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).
functiongetStringValueWithoutFormat()
Gets cell's value as string without any format.
functiongetType()
Represents cell value type. The value of the property is CellValueType integer constant.
functiongetValue()
function
setValue(value)
           Gets/sets the value contained in this cell.
functiongetWorksheet()
Gets the parent worksheet.
 
Method Summary
functioncalculate(options)
Calculates the formula of the cell.
functioncharacters(startIndex, length)
Returns a Characters object that represents a range of characters within the cell text.
functioncopy(cell)
Copies data from a source cell.
functionequals(cell)
Checks whether this object refers to the same cell with another cell object.
functionequals(obj)
Checks whether this object refers to the same cell with another.
functiongetArrayRange()
Gets the array range if the cell's formula is an array formula.
functiongetCharacters()
Returns all Characters objects that represents a range of characters within the cell text.
functiongetCharacters(flag)
Returns all Characters objects that represents a range of characters within the cell text.
functiongetConditionalFormattingResult()
Get the result of the conditional formatting.
functiongetDependents(isAll)
Get all cells whose formula references to this cell directly.
functiongetDependentsInCalculation(recursive)
Gets all cells whose calculated result depends on this cell.
functiongetDisplayStyle()
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().
functiongetDisplayStyle(includeMergedBorders)
Gets the display style of the cell. If the cell is conditional formatted, the display style is not same as the cell.GetStyle().
functiongetFormatConditions()
Gets format conditions which applies to this cell.
functiongetFormula(isR1C1, isLocal)
Get the formula of this cell.
functiongetHeightOfValue()
Gets the height of the value in unit of pixels.
functiongetHtmlString(html5)
Gets the html string which contains data and some formats in this cell.
functiongetLeafs()
Get all cells which reference to this cell directly and need to be updated when this cell is modified.
functiongetLeafs(recursive)
Get all cells which will be updated when this cell is modified.
functiongetMergedRange()
Returns a Range object which represents a merged range.
functiongetPrecedents()
Gets all references appearing in this cell's formula.
functiongetPrecedentsInCalculation()
Gets all precedents(reference to cells in current workbook) used by this cell's formula while calculating it.
functiongetStringValue(formatStrategy)
Gets the string value by specific formatted strategy.
functiongetStyle()
Gets the cell style.
functiongetStyle(checkBorders)
If checkBorders is true, check whether other cells' borders will effect the style of this cell.
functiongetTable()
Gets the table which contains this cell.
functiongetValidation()
Gets the validation applied to this cell.
functiongetValidationValue()
Gets the value of validation which applied to this cell.
functiongetWidthOfValue()
Gets the width of the value in unit of pixels.
functionhashCode()
Serves as a hash function for a particular type.
functioninsertText(index, text)
Insert some characters to the cell. If the cell is rich formatted, this method could keep the original formatting.
functionisRichText()
Indicates whether the string value of this cell is a rich formatted text.
functionputValue(boolValue)
Puts a boolean value into the cell.
functionputValue(dateTime)
Puts a DateTime value into the cell.
functionputValue(doubleValue)
Puts a double value into the cell.
functionputValue(intValue)
Puts an integer value into the cell.
functionputValue(objectValue)
Puts an object value into the cell.
functionputValue(stringValue)
Puts a string value into the cell.
functionputValue(stringValue, isConverted)
Puts a string value into the cell and converts the value to other data type if appropriate.
functionputValue(stringValue, isConverted, 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.
functionremoveArrayFormula(leaveNormalFormula)
Remove array formula.
functionreplace(placeHolder, newValue, options)
Replace text of the cell with options.
functionsetArrayFormula(arrayFormula, rowNumber, columnNumber)
Sets an array formula(legacy array formula entered via CTRL+SHIFT+ENTER in ms excel) to a range of cells.
functionsetArrayFormula(arrayFormula, rowNumber, columnNumber, isR1C1, isLocal)
Sets an array formula to a range of cells.
functionsetArrayFormula(arrayFormula, rowNumber, columnNumber, options)
Sets an array formula to a range of cells.
functionsetArrayFormula(arrayFormula, rowNumber, columnNumber, options, values)
Sets an array formula to a range of cells.
functionsetCharacters(characters)
Sets rich text format of the cell.
functionsetDynamicArrayFormula(arrayFormula, options, calculateValue)
Sets dynamic array formula and make the formula spill into neighboring cells if possible.
functionsetDynamicArrayFormula(arrayFormula, options, values, calculateRange, calculateValue)
Sets dynamic array formula and make the formula spill into neighboring cells if possible.
functionsetDynamicArrayFormula(arrayFormula, options, values, calculateRange, calculateValue, copts)
Sets dynamic array formula and make the formula spill into neighboring cells if possible.
functionsetFormula(formula, isR1C1, isLocal, value)
Set the formula and the value of the formula.
functionsetFormula(formula, options, value)
Set the formula and the value(calculated result) of the formula.
functionsetFormula(formula, value)
Set the formula and the value(calculated result) of the formula.
functionsetSharedFormula(sharedFormula, rowNumber, columnNumber)
Sets shared formulas to a range of cells.
functionsetSharedFormula(sharedFormula, rowNumber, columnNumber, isR1C1, isLocal)
Sets a formula to a range of cells.
functionsetSharedFormula(sharedFormula, rowNumber, columnNumber, options)
Sets shared formulas to a range of cells.
functionsetSharedFormula(sharedFormula, rowNumber, columnNumber, options, values)
Sets shared formulas to a range of cells.
functionsetStyle(style)
Sets the cell style.
functionsetStyle(style, explicitFlag)
Apply the changed property of style to the cell.
functionsetStyle(style, flag)
Apply the cell style based on flags.
functionsetTableFormula(rowNumber, columnNumber, rowIndexOfInputCell, columnIndexOfInputCell, isRowInput, values)
Create one-variable data table for given range starting from this cell.
functionsetTableFormula(rowNumber, columnNumber, rowIndexOfRowInputCell, columnIndexOfRowInputCell, rowIndexOfColumnInputCell, columnIndexOfColumnInputCell, values)
Create two-variable data table for given range starting from this cell.
functionsetTableFormula(rowNumber, columnNumber, inputCell, isRowInput, values)
Create one-variable data table for given range starting from this cell.
functionsetTableFormula(rowNumber, columnNumber, rowInputCell, columnInputCell, values)
Create two-variable data table for given range starting from this cell.
functiontoJson()
Convert Cell to JSON struct data.
functiontoString()
Returns a string represents the current Cell object.
 

    • Property Getters/Setters Detail

      • getWorksheet : Worksheet 

        function getWorksheet()
        
        Gets the parent worksheet.
      • getDateTimeValue : DateTime 

        function getDateTimeValue()
        
        Gets the DateTime value contained in the cell.
      • getRow : Number 

        function getRow()
        
        Gets row number (zero based) of the cell. Cell row number
      • getColumn : Number 

        function getColumn()
        
        Gets column number (zero based) of the cell.
      • isFormula : boolean 

        function isFormula()
        
        Represents if the specified cell contains formula.
      • getType : Number 

        function getType()
        
        Represents cell value type. The value of the property is CellValueType integer constant.
      • getName : String 

        function getName()
        
        Gets the name of the cell. A cell name includes its column letter and row number. For example, the name of a cell in row 0 and column 0 is A1.
      • isErrorValue : boolean 

        function isErrorValue()
        
        Checks if the value of this cell is an error. Also applies to formula cell to check whether the calculated result is an error.
      • isNumericValue : boolean 

        function isNumericValue()
        
        Indicates whether the value of this cell is numeric(int, double and datetime) Also applies to formula cell to check the calculated result
      • getStringValue : String 

        function 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).
      • getStringValueWithoutFormat : String 

        function getStringValueWithoutFormat()
        
        Gets cell's value as string without any format. NOTE: This method is now obsolete. Instead, User should get the value object and format it according to the value type and the specific requirement. This property will be removed 12 months later since December 2020. Aspose apologizes for any inconvenience you may have experienced.
      • getNumberCategoryType : Number 

        function getNumberCategoryType()
        
        Represents the category type of this cell's number formatting. The value of the property is NumberCategoryType integer constant.When cell's formatting pattern is combined with conditional formatting patterns, then the returned type is corresponding to the part which is used for current value of this cell. For example, if the formatting pattern for this cell is "#,##0;(#,##0);"-";@", then when cell's value is numeric and not 0, the returned type is NumberCategoryType.NUMBER; When cell's value is 0 or not numeric value, the returned type is NumberCategoryType.TEXT.
      • getDisplayStringValue : String 

        function getDisplayStringValue()
        
        Gets the formatted string value of this cell by cell's display style.
      • getIntValue : Number 

        function getIntValue()
        
        Gets the integer value contained in the cell.
      • getDoubleValue : Number 

        function getDoubleValue()
        
        Gets the double value contained in the cell.
      • getFloatValue : Number 

        function getFloatValue()
        
        Gets the float value contained in the cell.
      • getBoolValue : boolean 

        function getBoolValue()
        
        Gets the boolean value contained in the cell.
      • hasCustomStyle : boolean 

        function hasCustomStyle()
        
        Indicates whether this cell has custom style settings(different from the default one inherited from corresponding row, column, or workbook).
      • getSharedStyleIndex : Number 

        function getSharedStyleIndex()
        
        Gets cell's shared style index in the style pool.
      • getFormula/setFormula : String 

        function getFormula() / function setFormula(value)
        
        Gets or sets a formula of the Cell. A formula string always begins with an equal sign (=). And please always use comma(,) as parameters delimiter, such as "=SUM(A1, E1, H2)".

        Example:

        $workbook = new cells\Workbook();
        $cells = $workbook->getWorksheets()->get(0)->getCells();
        $cells->get("B6")->setFormula("=SUM(B2:B5, E1) + sheet1!A1");
      • getFormulaLocal/setFormulaLocal : String 

        function getFormulaLocal() / function setFormulaLocal(value)
        
        Get the locale formatted formula of the cell.
      • getR1C1Formula/setR1C1Formula : String 

        function getR1C1Formula() / function setR1C1Formula(value)
        
        Gets or sets a R1C1 formula of the Cell.
      • containsExternalLink : boolean 

        function containsExternalLink()
        
        Indicates whether this cell contains an external link. Only applies when the cell is a formula cell.
      • isArrayHeader : boolean 

        function isArrayHeader()
        
        Indicates the cell's formula is an array formula and it is the first cell of the array.
      • isDynamicArrayFormula : boolean 

        function isDynamicArrayFormula()
        
        Indicates whether the cell's formula is dynamic array formula(true) or legacy array formula(false).
      • isArrayFormula : boolean 

        function isArrayFormula()
        
        Indicates whether the cell formula is an array formula.
      • isInArray : boolean 

        function isInArray()
        
        Indicates whether the cell formula is an array formula. NOTE: This class is now obsolete. Instead, please use Cell.IsArrayFormula to check whether the cell formula is an array formula. This property will be removed 12 months later since May 2018. Aspose apologizes for any inconvenience you may have experienced.
      • isSharedFormula : boolean 

        function isSharedFormula()
        
        Indicates whether the cell formula is part of shared formula.
      • isTableFormula : boolean 

        function isTableFormula()
        
        Indicates whether this cell is part of table formula.
      • isInTable : boolean 

        function isInTable()
        
        Indicates whether this cell is part of table formula. NOTE: This class is now obsolete. Instead, please use Cell.IsTableFormula to check whether the cell formula is part of table formula. This property will be removed 12 months later since May 2018. Aspose apologizes for any inconvenience you may have experienced.
      • getValue/setValue : Object 

        function getValue() / function setValue(value)
        
        Gets/sets the value contained in this cell. Possible type:

        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 : boolean 

        function isStyleSet()
        
        Indicates if the cell's style is set. If return false, it means this cell has a default cell format.
      • isMerged : boolean 

        function isMerged()
        
        Checks if a cell is part of a merged range or not.
      • getComment : Comment 

        function getComment()
        
        Gets the comment of this cell. If there is no comment applies to the cell, returns null.
      • getHtmlString/setHtmlString : String 

        function getHtmlString() / function setHtmlString(value)
        
        Gets and sets the html string which contains data and some formats in this cell.
      • getEmbeddedImage/setEmbeddedImage : byte[] 

        function getEmbeddedImage() / function setEmbeddedImage(value)
        
        Gets and sets the embeddedn image in the cell.
    • Method Detail

      • setDynamicArrayFormula

        function setDynamicArrayFormula(arrayFormula, options, calculateValue)
        Sets dynamic array formula and make the formula spill into neighboring cells if possible.
        Parameters:
        arrayFormula: String - the formula expression
        options: FormulaParseOptions - options to parse formula. "Parse" option will be ignored and the formula will always be parsed immediately
        calculateValue: boolean - whether calculate this dynamic array formula for those cells in the spilled range.
        Returns:
        the range that the formula should spill into.
      • setDynamicArrayFormula

        function setDynamicArrayFormula(arrayFormula, options, values, calculateRange, calculateValue)
        Sets dynamic array formula and make the formula spill into neighboring cells if possible.
        Parameters:
        arrayFormula: String - the formula expression
        options: FormulaParseOptions - options to parse formula. "Parse" option will be ignored and the formula will always be parsed immediately
        values: Object[][] - values(calculated results) for those cells with given dynamic array formula
        calculateRange: boolean - 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: boolean - 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.
        Returns:
        the range that the formula should spill into.
      • setDynamicArrayFormula

        function setDynamicArrayFormula(arrayFormula, options, values, calculateRange, calculateValue, copts)
        Sets dynamic array formula and make the formula spill into neighboring cells if possible.
        Parameters:
        arrayFormula: String - the formula expression
        options: FormulaParseOptions - options to parse formula. "Parse" option will be ignored and the formula will always be parsed immediately
        values: Object[][] - values(calculated results) for those cells with given dynamic array formula
        calculateRange: boolean - 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: boolean - 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: CalculationOptions - The options for calculating formula. Commonly, for performance consideration, the CalculationOptions.Recursive property should be false.
        Returns:
        the range that the formula should spill into.
      • setTableFormula

        function setTableFormula(rowNumber, columnNumber, rowInputCell, columnInputCell, values)
        Create two-variable data table for given range starting from this cell.
        Parameters:
        rowNumber: Number - Number of rows to populate the formula.
        columnNumber: Number - Number of columns to populate the formula.
        rowInputCell: String - the row input cell
        columnInputCell: String - the column input cell
        values: Object[][] - values for cells in table formula range
      • setTableFormula

        function setTableFormula(rowNumber, columnNumber, inputCell, isRowInput, values)
        Create one-variable data table for given range starting from this cell.
        Parameters:
        rowNumber: Number - Number of rows to populate the formula.
        columnNumber: Number - Number of columns to populate the formula.
        inputCell: String - the input cell
        isRowInput: boolean - Indicates whether the input cell is a row input cell(true) or a column input cell(false).
        values: Object[][] - values for cells in table formula range
      • setTableFormula

        function setTableFormula(rowNumber, columnNumber, rowIndexOfRowInputCell, columnIndexOfRowInputCell, rowIndexOfColumnInputCell, columnIndexOfColumnInputCell, values)
        Create two-variable data table for given range starting from this cell.
        Parameters:
        rowNumber: Number - Number of rows to populate the formula.
        columnNumber: Number - Number of columns to populate the formula.
        rowIndexOfRowInputCell: Number - row index of the row input cell
        columnIndexOfRowInputCell: Number - column index of the row input cell
        rowIndexOfColumnInputCell: Number - row index of the column input cell
        columnIndexOfColumnInputCell: Number - column index of the column input cell
        values: Object[][] - values for cells in table formula range
      • setTableFormula

        function setTableFormula(rowNumber, columnNumber, rowIndexOfInputCell, columnIndexOfInputCell, isRowInput, values)
        Create one-variable data table for given range starting from this cell.
        Parameters:
        rowNumber: Number - Number of rows to populate the formula.
        columnNumber: Number - Number of columns to populate the formula.
        rowIndexOfInputCell: Number - row index of the input cell
        columnIndexOfInputCell: Number - column index of the input cell
        isRowInput: boolean - Indicates whether the input cell is a row input cell(true) or a column input cell(false).
        values: Object[][] - values for cells in table formula range
      • removeArrayFormula

        function removeArrayFormula(leaveNormalFormula)
        Remove array formula.
        Parameters:
        leaveNormalFormula: boolean - True represents converting the array formula to normal formula.
      • copy

        function copy(cell)
        Copies data from a source cell.
        Parameters:
        cell: Cell - Source Cell object.
      • characters

        function characters(startIndex, length)
        Returns a Characters object that represents a range of characters within the cell text. This method only works on cell with string value.
        Parameters:
        startIndex: Number - The index of the start of the character.
        length: Number - The number of characters.
        Returns:
        Characters object.

        Example:

        $workbook = new cells\Workbook();
        $cell = $workbook->getWorksheets()->get(0)->getCells()->get("A1");
        $cell->putValue("Helloworld");
        $cell->characters(5, 5)->getFont()->setBold(true);
        $cell->characters(5, 5)->getFont()->setColor(cells\Color::getBlue());
      • replace

        function replace(placeHolder, newValue, options)
        Replace text of the cell with options.
        Parameters:
        placeHolder: String - Cell placeholder
        newValue: String - String value to replace
        options: ReplaceOptions - The replace options
      • insertText

        function insertText(index, text)
        Insert some characters to the cell. If the cell is rich formatted, this method could keep the original formatting.
        Parameters:
        index: Number - The index.
        text: String - Inserted text.
      • isRichText

        function isRichText()
        Indicates whether the string value of this cell is a rich formatted text.
      • getCharacters

        function getCharacters()
        Returns all Characters objects that represents a range of characters within the cell text.
        Returns:
        All Characters objects
      • getCharacters

        function getCharacters(flag)
        Returns all Characters objects that represents a range of characters within the cell text.
        Parameters:
        flag: boolean - Indicates whether applying table style to the cell if the cell is in the table.
        Returns:
        All Characters objects
      • setCharacters

        function setCharacters(characters)
        Sets rich text format of the cell.
        Parameters:
        characters: FontSetting[] - All Characters objects.
      • getMergedRange

        function getMergedRange()
        Returns a Range object which represents a merged range.
        Returns:
        Range object. Null if this cell is not merged.
      • getHtmlString

        function getHtmlString(html5)
        Gets the html string which contains data and some formats in this cell.
        Parameters:
        html5: boolean - Indicates whether the value is compatible for html5
        Returns:
      • toString

        function toString()
        Returns a string represents the current Cell object.
        Returns:
      • toJson

        function toJson()
        Convert Cell to JSON struct data.
        Returns:
      • equals

        function equals(obj)
        Checks whether this object refers to the same cell with another.
        Parameters:
        obj: Object - another object
        Returns:
        true if two objects refers to the same cell.
      • hashCode

        function hashCode()
        Serves as a hash function for a particular type.
        Returns:
        A hash code for current Cell object.
      • equals

        function equals(cell)
        Checks whether this object refers to the same cell with another cell object.
        Parameters:
        cell: Cell - another cell object
        Returns:
        true if two cell objects refers to the same cell.
      • getConditionalFormattingResult

        function getConditionalFormattingResult()
        Get the result of the conditional formatting. Returns null if no conditional formatting is applied to this cell,
      • getValidation

        function getValidation()
        Gets the validation applied to this cell.
        Returns:
      • getValidationValue

        function getValidationValue()
        Gets the value of validation which applied to this cell.
        Returns:
      • getTable

        function getTable()
        Gets the table which contains this cell.
        Returns:
      • calculate

        function calculate(options)
        Calculates the formula of the cell.
        Parameters:
        options: CalculationOptions - Options for calculation
      • putValue

        function putValue(boolValue)
        Puts a boolean value into the cell.
        Parameters:
        boolValue: boolean -
      • putValue

        function putValue(intValue)
        Puts an integer value into the cell.
        Parameters:
        intValue: Number - Input value
      • putValue

        function putValue(doubleValue)
        Puts a double value into the cell.
        Parameters:
        doubleValue: Number - Input value
      • putValue

        function putValue(stringValue, isConverted, 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.
        Parameters:
        stringValue: String - Input value
        isConverted: boolean - True: converted to other data type if appropriate.
        setStyle: boolean - True: set the number format to cell's style when converting to other data type
      • putValue

        function putValue(stringValue, isConverted)
        Puts a string value into the cell and converts the value to other data type if appropriate.
        Parameters:
        stringValue: String - Input value
        isConverted: boolean - True: converted to other data type if appropriate.
      • putValue

        function putValue(stringValue)
        Puts a string value into the cell.
        Parameters:
        stringValue: String - Input value
      • putValue

        function putValue(dateTime)
        Puts a DateTime value into the cell. Setting a DateTime value for a cell dose not means the cell will be formatted as date time automatically. DateTime value was maintained as numeric value in the data model of both ms excel and Aspose.Cells. Whether the numeric value will be taken as the numeric value itself or date time depends on the number format applied on this cell. If this cell has not been formatted as date time, it will be displayed as a numeric value even though what you input is DateTime.
        Parameters:
        dateTime: DateTime - Input value
      • putValue

        function putValue(objectValue)
        Puts an object value into the cell.
        Parameters:
        objectValue: Object - input value
      • getStringValue

        function getStringValue(formatStrategy)
        Gets the string value by specific formatted strategy.
        Parameters:
        formatStrategy: Number - A CellValueFormatStrategy value. The formatted strategy.
        Returns:
      • getWidthOfValue

        function getWidthOfValue()
        Gets the width of the value in unit of pixels.
        Returns:
      • getHeightOfValue

        function getHeightOfValue()
        Gets the height of the value in unit of pixels.
        Returns:
      • getDisplayStyle

        function 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().
      • getDisplayStyle

        function getDisplayStyle(includeMergedBorders)
        Gets the display style of the cell. If the cell is conditional formatted, the display style is not same as the cell.GetStyle().
        Parameters:
        includeMergedBorders: boolean - Indicates whether checking borders of the merged cells.
      • getFormatConditions

        function getFormatConditions()
        Gets format conditions which applies to this cell.
        Returns:
        Returns FormatConditionCollection object
      • getStyle

        function getStyle()
        Gets the cell style. To change the style of the cell, please call Cell.SetStyle() method after modifying the returned style object. This method is same with getStyle(boolean) with true value for the parameter.
        Returns:
        Style object.
      • getStyle

        function getStyle(checkBorders)
        If checkBorders is true, check whether other cells' borders will effect the style of this cell.
        Parameters:
        checkBorders: boolean - Check other cells' borders
        Returns:
        Style object.
      • setStyle

        function setStyle(style)
        Sets the cell style. If the border settings are changed, the border of adjust cells will be updated too.
        Parameters:
        style: Style - The cell style.
      • setStyle

        function setStyle(style, explicitFlag)
        Apply the changed property of style to the cell.
        Parameters:
        style: Style - The cell style.
        explicitFlag: boolean - True, only overwriting formatting which is explicitly set.
      • setStyle

        function setStyle(style, flag)
        Apply the cell style based on flags.
        Parameters:
        style: Style - The cell style.
        flag: StyleFlag - The style flag.
      • setFormula

        function setFormula(formula, value)
        Set the formula and the value(calculated result) of the formula.
        Parameters:
        formula: String - The formula.
        value: Object - The value(calculated result) of the formula.
      • getFormula

        function getFormula(isR1C1, isLocal)
        Get the formula of this cell.
        Parameters:
        isR1C1: boolean - Whether the formula needs to be formatted as R1C1.
        isLocal: boolean - Whether the formula needs to be formatted by locale.
        Returns:
        the formula of this cell.
      • setFormula

        function setFormula(formula, isR1C1, isLocal, value)
        Set the formula and the value of the formula. NOTE: This class is now obsolete. Instead, please use Cell.SetFormula(string,FormulaParseOptions,object). This property will be removed 12 months later since December 2019. Aspose apologizes for any inconvenience you may have experienced.
        Parameters:
        formula: String - The formula.
        isR1C1: boolean - Whether the formula is R1C1 formula.
        isLocal: boolean - Whether the formula is locale formatted.
        value: Object - The value of the formula.
      • setFormula

        function setFormula(formula, options, value)
        Set the formula and the value(calculated result) of the formula.
        Parameters:
        formula: String - The formula.
        options: FormulaParseOptions - Options for parsing the formula.
        value: Object - The value(calculated result) of the formula.
      • setArrayFormula

        function setArrayFormula(arrayFormula, rowNumber, columnNumber, isR1C1, isLocal)
        Sets an array formula to a range of cells. NOTE: This class is now obsolete. Instead, please use Cell.SetArrayFormula(string,int,int,FormulaParseOptions). This property will be removed 12 months later since December 2019. Aspose apologizes for any inconvenience you may have experienced.
        Parameters:
        arrayFormula: String - Array formula.
        rowNumber: Number - Number of rows to populate result of the array formula.
        columnNumber: Number - Number of columns to populate result of the array formula.
        isR1C1: boolean - whether the formula is R1C1 formula
        isLocal: boolean - whether the formula is locale formatted
      • setArrayFormula

        function setArrayFormula(arrayFormula, rowNumber, columnNumber)
        Sets an array formula(legacy array formula entered via CTRL+SHIFT+ENTER in ms excel) to a range of cells.
        Parameters:
        arrayFormula: String - Array formula.
        rowNumber: Number - Number of rows to populate result of the array formula.
        columnNumber: Number - Number of columns to populate result of the array formula.
      • setArrayFormula

        function setArrayFormula(arrayFormula, rowNumber, columnNumber, options)
        Sets an array formula to a range of cells.
        Parameters:
        arrayFormula: String - Array formula.
        rowNumber: Number - Number of rows to populate result of the array formula.
        columnNumber: Number - Number of columns to populate result of the array formula.
        options: FormulaParseOptions - Options for parsing the formula.
      • setArrayFormula

        function setArrayFormula(arrayFormula, rowNumber, columnNumber, options, values)
        Sets an array formula to a range of cells.
        Parameters:
        arrayFormula: String - Array formula.
        rowNumber: Number - Number of rows to populate result of the array formula.
        columnNumber: Number - Number of columns to populate result of the array formula.
        options: FormulaParseOptions - Options for parsing the formula.
        values: Object[][] - values for those cells with given array formula
      • setSharedFormula

        function setSharedFormula(sharedFormula, rowNumber, columnNumber, isR1C1, isLocal)
        Sets a formula to a range of cells. NOTE: This class is now obsolete. Instead, please use Cell.SetSharedFormula(string,int,int,FormulaParseOptions). This property will be removed 12 months later since December 2019. Aspose apologizes for any inconvenience you may have experienced.
        Parameters:
        sharedFormula: String - Shared formula.
        rowNumber: Number - Number of rows to populate the formula.
        columnNumber: Number - Number of columns to populate the formula.
        isR1C1: boolean - whether the formula is R1C1 formula
        isLocal: boolean - whether the formula is locale formatted
      • setSharedFormula

        function setSharedFormula(sharedFormula, rowNumber, columnNumber)
        Sets shared formulas to a range of cells.
        Parameters:
        sharedFormula: String - Shared formula.
        rowNumber: Number - Number of rows to populate the formula.
        columnNumber: Number - Number of columns to populate the formula.
      • setSharedFormula

        function setSharedFormula(sharedFormula, rowNumber, columnNumber, options)
        Sets shared formulas to a range of cells.
        Parameters:
        sharedFormula: String - Shared formula.
        rowNumber: Number - Number of rows to populate the formula.
        columnNumber: Number - Number of columns to populate the formula.
        options: FormulaParseOptions - Options for parsing the formula.
      • setSharedFormula

        function setSharedFormula(sharedFormula, rowNumber, columnNumber, options, values)
        Sets shared formulas to a range of cells.
        Parameters:
        sharedFormula: String - Shared formula.
        rowNumber: Number - Number of rows to populate the formula.
        columnNumber: Number - Number of columns to populate the formula.
        options: FormulaParseOptions - Options for parsing the formula.
        values: Object[][] - values for those cells with given shared formula
      • getPrecedents

        function getPrecedents()
        Gets all references appearing in this cell's formula.
        • Returns null if this is not a formula cell.
        • All references appearing in this cell's formula will be returned no matter they are referenced or not while calculating. For example, although cell A2 in formula "=IF(TRUE,A1,A2)" is not used while calculating, it is still taken as the formula's precedents.
        • To get those references which influence the calculation only, please use getPrecedentsInCalculation().
        Returns:
        Collection of all references appearing in this cell's formula.

        Example:

        $workbook = new cells\Workbook();
        $cells = $workbook->getWorksheets()->get(0)->getCells();
        $cells->get("A1")->setFormula("= B1 + SUM(B1:B10) + [Book1.xls]Sheet1!A1");
        $areas =$cells->get("A1")->getPrecedents();
        for ($i = 0; $i < java_values($areas->getCount()); $i++)
        {
            $area = $areas->get($i);
            $stringBuilder = "";
            if (java_values($area->isExternalLink()))
            {
                $stringBuilder .= "[";
                $stringBuilder .= $area->getExternalFileName();
                $stringBuilder .= "]";
            }
            $stringBuilder .= $area->getSheetName();
            $stringBuilder .= "!";
            $stringBuilder .= cells\CellsHelper::cellIndexToName($area->getStartRow(), $area->getStartColumn());
            if (java_values($area->isArea()))
            {
                $stringBuilder .= ":";
                $stringBuilder .= cells\CellsHelper::cellIndexToName($area->getEndRow(), $area->getEndColumn());
            }
            echo "Precedent ".$i.": ".$stringBuilder."\n";
        }
      • getDependents

        function getDependents(isAll)
        Get all cells whose formula references to this cell directly.
        • If one reference containing this cell appears in one cell's formula, that cell will be taken as the dependent of this cell, no matter the reference or this cell is used or not while calculating. For example, although cell A2 in formula "=IF(TRUE,A1,A2)" is not used while calculating, this formula is still be taken as A2's dependent.
        • To get those formulas whose calculated results depend on this cell, please use getDependentsInCalculation(boolean).
        • When tracing dependents for one cell, all formulas in the workbook or worksheet will be analized and checked. So it is a time consumed process. If user need to trace dependents for lots of cells, using this method will cause poor performance. For performance consideration, user should use getDependentsInCalculation(boolean) instead. Or, user may gather precedents map of all cells by getPrecedents() firstly, and then build the dependents map according to the precedents map.
        Parameters:
        isAll: boolean - Indicates whether check formulas in other worksheets
      • getPrecedentsInCalculation

        function getPrecedentsInCalculation()
        Gets all precedents(reference to cells in current workbook) used by this cell's formula while calculating it. This method can only work with the situation that FormulaSettings.EnableCalculationChain is true for the workbook and the workbook has been fully calculated. If this cell is not a formula or it does not reference to any other cells, null will be returned.
        Returns:
        Enumerator to enumerate all references(ReferredArea)
      • getDependentsInCalculation

        function getDependentsInCalculation(recursive)
        Gets all cells whose calculated result depends on this cell. To use this method, please make sure the workbook has been set with true value for FormulaSettings.EnableCalculationChain and has been fully calculated with this setting. If there is no formula reference to this cell, null will be returned.
        Parameters:
        recursive: boolean - Whether returns those dependents which do not reference to this cell directly but reference to other leafs of this cell
        Returns:
        Enumerator to enumerate all dependents(Cell objects)
      • getLeafs

        function getLeafs()
        Get all cells which reference to this cell directly and need to be updated when this cell is modified. NOTE: This class is now obsolete. Instead, please use Cell.GetDependentsInCalculation(bool) to get all dependents in calculation chain. This property will be removed 12 months later since May 2022. Aspose apologizes for any inconvenience you may have experienced.
        Returns:
        Enumerator to enumerate all dependents(Cell)
      • getLeafs

        function getLeafs(recursive)
        Get all cells which will be updated when this cell is modified. NOTE: This class is now obsolete. Instead, please use Cell.GetDependentsInCalculation(bool) to get all dependents in calculation chain. This property will be removed 12 months later since May 2022. Aspose apologizes for any inconvenience you may have experienced.
        Parameters:
        recursive: boolean - Whether returns those leafs that do not reference to this cell directly but reference to other leafs of this cell
        Returns:
        Enumerator to enumerate all dependents(Cell)
      • getArrayRange

        function getArrayRange()
        Gets the array range if the cell's formula is an array formula. Only applies when the cell's formula is an array formula
        Returns:
        The array range.