Aspose::Cells::ICell Class Referenceabstract

Encapsulates the object that represents a single Workbook cell. More...

Inherits Object.

Public Member Functions

virtual void Calculate (intrusive_ptr< Aspose::Cells::ICalculationOptions > options)=0
 Calculates the formula of the cell. More...
 
virtual void Calculate (bool ignoreError, intrusive_ptr< Aspose::Cells::ICustomFunction > customFunction)=0
 Calculates the formula of the cell. More...
 
virtual intrusive_ptr< Aspose::Cells::IWorksheetGetIWorksheet ()=0
 Gets the parent worksheet. More...
 
virtual void PutValue (bool boolValue)=0
 Puts an boolean value into the cell. More...
 
virtual void PutValue (Aspose::Cells::Systems::Int32 intValue)=0
 Puts an integer value into the cell. More...
 
virtual void PutValue (Aspose::Cells::Systems::Double doubleValue)=0
 Puts a double value into the cell. More...
 
virtual void PutValue (intrusive_ptr< Aspose::Cells::Systems::String > stringValue, bool isConverted, bool setStyle)=0
 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. More...
 
virtual void PutValue (intrusive_ptr< Aspose::Cells::Systems::String > stringValue, bool isConverted)=0
 Puts a string value into the cell and converts the value to other data type if appropriate. More...
 
virtual void PutValue (intrusive_ptr< Aspose::Cells::Systems::String > stringValue)=0
 Puts a string value into the cell. More...
 
virtual void PutValue (intrusive_ptr< Aspose::Cells::Systems::DateTime > dateTime)=0
 Puts a DateTime value into the cell. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::DateTime > GetDateTimeValue ()=0
 Gets the DateTime value contained in the cell. More...
 
virtual void PutValue (intrusive_ptr< Aspose::Cells::Systems::Object > objectValue)=0
 Puts an object value into the cell. More...
 
virtual Aspose::Cells::Systems::Int32 GetRow ()=0
 Gets row number (zero based) of the cell. More...
 
virtual Aspose::Cells::Systems::Int32 GetColumn ()=0
 Gets column number (zero based) of the cell. More...
 
virtual bool IsFormula ()=0
 Represents if the specified cell contains formula. More...
 
virtual Aspose::Cells::CellValueType GetType ()=0
 Represents cell value type. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetName ()=0
 Gets the name of the cell. More...
 
virtual bool IsErrorValue ()=0
 Checks if a formula can properly evaluate a result. More...
 
virtual bool IsNumericValue ()=0
 Indicates whether the inner value of this cell is numeric(int, double and datetime) More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetStringValue (Aspose::Cells::CellValueFormatStrategy formatStrategy)=0
 Gets the string value by specific formatted strategy. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetStringValue ()=0
 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). More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetStringValueWithoutFormat ()=0
 Gets cell's value as string without any format. More...
 
virtual Aspose::Cells::NumberCategoryType GetNumberCategoryType ()=0
 Represents the category type of this cell's number formatting. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetDisplayStringValue ()=0
 Gets the formatted string value of this cell by cell's display style. More...
 
virtual Aspose::Cells::Systems::Int32 GetIntValue ()=0
 Gets the integer value contained in the cell. More...
 
virtual Aspose::Cells::Systems::Double GetDoubleValue ()=0
 Gets the double value contained in the cell. More...
 
virtual Aspose::Cells::Systems::Single GetFloatValue ()=0
 Gets the float value contained in the cell. More...
 
virtual bool GetBoolValue ()=0
 Gets the boolean value contained in the cell. More...
 
virtual Aspose::Cells::Systems::Int32 GetWidthOfValue ()=0
 Gets the width of the value in unit of pixels. More...
 
virtual Aspose::Cells::Systems::Int32 GetHeightOfValue ()=0
 Gets the height of the value in unit of pixels. More...
 
virtual intrusive_ptr< Aspose::Cells::IStyleGetDisplayIStyle ()=0
 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(). More...
 
virtual intrusive_ptr< Aspose::Cells::IStyleGetDisplayIStyle (bool includeMergedBorders)=0
 Gets the display style of the cell. If the cell is conditional formatted, the display style is not same as the cell.GetStyle(). More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::IFormatConditionCollection * > > GetIFormatConditions ()=0
 Gets format conditions which applies to this cell. More...
 
virtual intrusive_ptr< Aspose::Cells::IStyleGetIStyle ()=0
 Gets the cell style. More...
 
virtual intrusive_ptr< Aspose::Cells::IStyleGetIStyle (bool checkBorders)=0
 If checkBorders is true, check whether other cells' borders will effect the style of this cell. More...
 
virtual void SetIStyle (intrusive_ptr< Aspose::Cells::IStyle > style)=0
 Sets the cell style. More...
 
virtual void SetIStyle (intrusive_ptr< Aspose::Cells::IStyle > style, bool explicitFlag)=0
 Apply the cell style. More...
 
virtual void SetIStyle (intrusive_ptr< Aspose::Cells::IStyle > style, intrusive_ptr< Aspose::Cells::IStyleFlag > flag)=0
 Apply the cell style. More...
 
virtual Aspose::Cells::Systems::Int32 GetSharedStyleIndex ()=0
 Gets cell's shared style index in the style pool. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetFormula ()=0
 Gets a formula of the ICell More...
 
virtual void SetFormula (intrusive_ptr< Aspose::Cells::Systems::String > value)=0
 Gets or sets a formula of the ICell More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetFormulaLocal ()=0
 Get the locale formatted formula of the cell. More...
 
virtual void SetFormulaLocal (intrusive_ptr< Aspose::Cells::Systems::String > value)=0
 Get the locale formatted formula of the cell. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetR1C1Formula ()=0
 Gets a R1C1 formula of the ICell More...
 
virtual void SetR1C1Formula (intrusive_ptr< Aspose::Cells::Systems::String > value)=0
 Sets a R1C1 formula of the ICell More...
 
virtual void SetFormula (intrusive_ptr< Aspose::Cells::Systems::String > formula, intrusive_ptr< Aspose::Cells::Systems::Object > value)=0
 Set the formula and the value of the formula. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetFormula (bool isR1C1, bool isLocal)=0
 Get the formula of this cell. More...
 
virtual void SetFormula (intrusive_ptr< Aspose::Cells::Systems::String > formula, bool isR1C1, bool isLocal, intrusive_ptr< Aspose::Cells::Systems::Object > value)=0
 Set the formula and the value of the formula. More...
 
virtual void SetArrayFormula (intrusive_ptr< Aspose::Cells::Systems::String > arrayFormula, Aspose::Cells::Systems::Int32 rowNumber, Aspose::Cells::Systems::Int32 columnNumber, bool isR1C1, bool isLocal)=0
 Sets an array formula to a range of cells. More...
 
virtual void SetSharedFormula (intrusive_ptr< Aspose::Cells::Systems::String > sharedFormula, Aspose::Cells::Systems::Int32 rowNumber, Aspose::Cells::Systems::Int32 columnNumber, bool isR1C1, bool isLocal)=0
 Sets a formula to a range of cells. More...
 
virtual bool ContainsExternalLink ()=0
 Indicates whether this cell contains an external link. Only applies when the cell is a formula cell. More...
 
virtual intrusive_ptr< Aspose::Cells::IReferredAreaCollectionGetIPrecedents ()=0
 Gets all cells or ranges which this cell's formula depends on. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::ICell * > > GetDependentICells (bool isAll)=0
 Get all cells which refer to the specific cell. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::Collections::IEnumerator > GetPrecedentsInCalculation ()=0
 Gets all precedents(reference to cells in current workbook) used by this cell's formula while calculating it. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::Collections::IEnumerator > GetDependentsInCalculation (bool recursive)=0
 Gets all cells whose calculated result depends on this cell. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::Collections::IEnumerator > GetLeafs ()=0
 Get all cells which will be updated when this cell is modified. This method can only work after calling CalculateFormula method of IWorkbook. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::Collections::IEnumerator > GetLeafs (bool recursive)=0
 Get all cells which will be updated when this cell is modified. More...
 
virtual bool IsArrayHeader ()=0
 Indicates the cell's formula is and array formula and it is the first cell of the array. More...
 
virtual intrusive_ptr< Aspose::Cells::ICellAreaGetArrayICellArea ()=0
 Gets the array range if the cell's formula is an array formula. More...
 
virtual bool IsArrayFormula ()=0
 Indicates whether the cell formula is an array formula. More...
 
virtual bool IsInArray ()=0
 Indicates whether the cell formula is an array formula. More...
 
virtual bool IsSharedFormula ()=0
 Indicates whether the cell formula is part of shared formula. More...
 
virtual bool IsTableFormula ()=0
 Indicates whether this cell is part of table formula. More...
 
virtual bool IsInTable ()=0
 
virtual void SetArrayFormula (intrusive_ptr< Aspose::Cells::Systems::String > arrayFormula, Aspose::Cells::Systems::Int32 rowNumber, Aspose::Cells::Systems::Int32 columnNumber)=0
 Sets an array formula(legacy array formula entered via CTRL+SHIFT+ENTER in ms excel) to a range of cells. More...
 
virtual void SetSharedFormula (intrusive_ptr< Aspose::Cells::Systems::String > sharedFormula, Aspose::Cells::Systems::Int32 rowNumber, Aspose::Cells::Systems::Int32 columnNumber)=0
 Sets a formula to a range of cells. More...
 
virtual void RemoveArrayFormula (bool leaveNormalFormula)=0
 Remove array formula. More...
 
virtual void Copy (intrusive_ptr< Aspose::Cells::ICell > cell)=0
 Copies data from a source cell. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::Object > GetValue ()=0
 Gets the value contained in this cell. More...
 
virtual void SetValue (intrusive_ptr< Aspose::Cells::Systems::Object > value)=0
 Gets the value contained in this cell. More...
 
virtual bool IsStyleSet ()=0
 Indicates if the cell's style is set. If return false, it means this cell has a default cell format. More...
 
virtual intrusive_ptr< Aspose::Cells::IFontSettingGetIFontSetting (Aspose::Cells::Systems::Int32 startIndex, Aspose::Cells::Systems::Int32 length)=0
 Returns a Characters object that represents a range of characters within the cell text. More...
 
virtual bool IsRichText ()=0
 Indicates whether the cell string value is a rich text. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::IFontSetting * > > GetIFontSettings ()=0
 Returns all Characters objects that represents a range of characters within the cell text. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::IFontSetting * > > GetIFontSettings (bool flag)=0
 Returns all Characters objects that represents a range of characters within the cell text. More...
 
virtual void SetIFontSettings (intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::IFontSetting *>> characters)=0
 Sets rich text format of the cell. More...
 
virtual bool IsMerged ()=0
 Checks if a cell is part of a merged range or not. More...
 
virtual intrusive_ptr< Aspose::Cells::IRangeGetMergedIRange ()=0
 Returns a IRange object which represents a merged range. More...
 
virtual intrusive_ptr< Aspose::Cells::ICommentGetIComment ()=0
 Gets the comment of this cell. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetHtmlString ()=0
 Gets the html string which contains data and some formats in this cell. More...
 
virtual void SetHtmlString (intrusive_ptr< Aspose::Cells::Systems::String > value)=0
 Sets the html string which contains data and some formats in this cell. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetHtmlString (bool html5)=0
 Gets the html string which contains data and some formats in this cell. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > ToString ()=0
 Returns a string represents the current Cell object. More...
 
virtual bool Equals (intrusive_ptr< Aspose::Cells::Systems::Object > obj)=0
 Checks whether this object refers to the same cell with another. More...
 
virtual Aspose::Cells::Systems::Int32 GetHashCode ()=0
 Serves as a hash function for a particular type. More...
 
virtual bool Equals (intrusive_ptr< Aspose::Cells::ICell > cell)=0
 Checks whether this object refers to the same cell with another cell object. More...
 
virtual intrusive_ptr< Aspose::Cells::IConditionalFormattingResultGetIConditionalFormattingResult ()=0
 Get the result of the conditional formatting. More...
 
virtual intrusive_ptr< Aspose::Cells::IValidationGetIValidation ()=0
 Gets the validation applied to this cell. More...
 
virtual bool GetValidationValue ()=0
 Gets the value of validation which applied to this cell. More...
 
virtual intrusive_ptr< Aspose::Cells::Tables::IListObjectGetITable ()=0
 Gets the table which contains this cell. More...
 

Detailed Description

Encapsulates the object that represents a single Workbook cell.

[C++]
intrusive_ptr<IWorkbook> excel = Factory::CreateIWorkbook();
intrusive_ptr<ICells> cells = excel->GetIWorksheets()->GetObjectByIndex(0)->GetICells();
//Put a string into a cell
intrusive_ptr<ICell> cell = cells->GetObjectByIndex(0,0);
cell->PutValue((StringPtr)new String("Hello"));
StringPtr first = cell->GetStringValue();
//Put an integer into a cell
cell = cells->GetObjectByIndex(new String("B1"));
cell->PutValue(12);
int second = cell->GetIntValue();
//Put a double into a cell
cell = cells->GetObjectByIndex(0, 2);
cell->PutValue(-1.234);
double third = cell->GetDoubleValue();
//Put a formula into a cell
cell = cells->GetObjectByIndex(new String("D1"));
cell->SetFormula(new String("=B1 + C1"));
//Put a combined formula: "sum(average(b1,c1), b1)" to cell at b2
cell = cells->GetObjectByIndex(new String("b2"));
cell->SetFormula(new String("=sum(average(b1,c1), b1)"));
<br>//Set style of a cell
intrusive_ptr<IStyle> style = cell->GetIStyle();
//Set background color
style->SetBackgroundColor(Color::GetYellow());
//Set format of a cell
style->GetIFont()->SetName(new String("Courier New"));
style->SetVerticalAlignment(TextAlignmentType::TextAlignmentType_Top);
cell->SetIStyle(style);

Member Function Documentation

◆ Calculate() [1/2]

virtual void Aspose::Cells::ICell::Calculate ( intrusive_ptr< Aspose::Cells::ICalculationOptions options)
pure virtual

Calculates the formula of the cell.

Parameters
optionsOptions for calculation

◆ Calculate() [2/2]

virtual void Aspose::Cells::ICell::Calculate ( bool  ignoreError,
intrusive_ptr< Aspose::Cells::ICustomFunction customFunction 
)
pure virtual

Calculates the formula of the cell.

Parameters
ignoreErrorIndicates if hide the error in calculating formulas. The error may be unsupported function, external links, etc.
customFunctionThe custom formula calculation functions to extend the calculation engine.

◆ ContainsExternalLink()

virtual bool Aspose::Cells::ICell::ContainsExternalLink ( )
pure virtual

Indicates whether this cell contains an external link. Only applies when the cell is a formula cell.

◆ Copy()

virtual void Aspose::Cells::ICell::Copy ( intrusive_ptr< Aspose::Cells::ICell cell)
pure virtual

Copies data from a source cell.

Parameters
cellSource Cell object.

◆ Equals() [1/2]

virtual bool Aspose::Cells::ICell::Equals ( intrusive_ptr< Aspose::Cells::Systems::Object >  obj)
pure virtual

Checks whether this object refers to the same cell with another.

Parameters
objanother object
Returns
true if two objects refers to the same cell.

◆ Equals() [2/2]

virtual bool Aspose::Cells::ICell::Equals ( intrusive_ptr< Aspose::Cells::ICell cell)
pure virtual

Checks whether this object refers to the same cell with another cell object.

Parameters
cellanother cell object
Returns
true if two cell objects refers to the same cell.

◆ GetArrayICellArea()

virtual intrusive_ptr<Aspose::Cells::ICellArea> Aspose::Cells::ICell::GetArrayICellArea ( )
pure virtual

Gets the array range if the cell's formula is an array formula.

Returns
The array range.

Only applies when the cell's formula is an array formula

◆ GetBoolValue()

virtual bool Aspose::Cells::ICell::GetBoolValue ( )
pure virtual

Gets the boolean value contained in the cell.

◆ GetColumn()

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::ICell::GetColumn ( )
pure virtual

Gets column number (zero based) of the cell.

◆ GetDateTimeValue()

virtual intrusive_ptr<Aspose::Cells::Systems::DateTime> Aspose::Cells::ICell::GetDateTimeValue ( )
pure virtual

Gets the DateTime value contained in the cell.

◆ GetDependentICells()

virtual intrusive_ptr<Aspose::Cells::Systems::Array1D<Aspose::Cells::ICell*> > Aspose::Cells::ICell::GetDependentICells ( bool  isAll)
pure virtual

Get all cells which refer to the specific cell.

Parameters
isAllIndicates whether check other worksheets

◆ GetDependentsInCalculation()

virtual intrusive_ptr<Aspose::Cells::Systems::Collections::IEnumerator> Aspose::Cells::ICell::GetDependentsInCalculation ( bool  recursive)
pure virtual

Gets all cells whose calculated result depends on this cell.

Parameters
recursiveWhether 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)

◆ GetDisplayIStyle() [1/2]

virtual intrusive_ptr<Aspose::Cells::IStyle> Aspose::Cells::ICell::GetDisplayIStyle ( )
pure virtual

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().

◆ GetDisplayIStyle() [2/2]

virtual intrusive_ptr<Aspose::Cells::IStyle> Aspose::Cells::ICell::GetDisplayIStyle ( bool  includeMergedBorders)
pure virtual

Gets the display style of the cell. If the cell is conditional formatted, the display style is not same as the cell.GetStyle().

Parameters
includeMergedBordersIndicates whether checking borders of the merged cells.

◆ GetDisplayStringValue()

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::ICell::GetDisplayStringValue ( )
pure virtual

Gets the formatted string value of this cell by cell's display style.

◆ GetDoubleValue()

virtual Aspose::Cells::Systems::Double Aspose::Cells::ICell::GetDoubleValue ( )
pure virtual

Gets the double value contained in the cell.

◆ GetFloatValue()

virtual Aspose::Cells::Systems::Single Aspose::Cells::ICell::GetFloatValue ( )
pure virtual

Gets the float value contained in the cell.

◆ GetFormula() [1/2]

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::ICell::GetFormula ( )
pure virtual

Gets a formula of the ICell

A formula string always begins with an equal sign (=). And please always use comma (,) as parameters delimiter, such as "=SUM(A1, E1, H2)".

User can set any formula in Workbook designer file. Aspose.Cells will keep all the formulas. If user use this property to set a formula to a cell, major part of Workbook built-in functions is supported. And more is coming. If you have any special need for Workbook built-in functions, please let us know.

[C++]
intrusive_ptr<IWorkbook> excel = Factory::CreateIWorkbook();
intrusive_ptr<ICells> cells = excel->GetIWorksheets()->GetObjectByIndex(0)->GetICells();
cells->GetObjectByIndex(new String("B6"))->SetFormula(new String("=SUM(B2:B5, E1) + sheet2!A1"));

◆ GetFormula() [2/2]

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::ICell::GetFormula ( bool  isR1C1,
bool  isLocal 
)
pure virtual

Get the formula of this cell.

Parameters
isR1C1Whether the formula needs to be formatted as R1C1.
isLocalWhether the formula needs to be formatted by locale.
Returns
the formula of this cell.

◆ GetFormulaLocal()

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::ICell::GetFormulaLocal ( )
pure virtual

Get the locale formatted formula of the cell.

◆ GetHashCode()

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::ICell::GetHashCode ( )
pure virtual

Serves as a hash function for a particular type.

Returns
A hash code for current Cell object.

◆ GetHeightOfValue()

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::ICell::GetHeightOfValue ( )
pure virtual

Gets the height of the value in unit of pixels.

Returns

◆ GetHtmlString() [1/2]

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::ICell::GetHtmlString ( )
pure virtual

Gets the html string which contains data and some formats in this cell.

◆ GetHtmlString() [2/2]

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::ICell::GetHtmlString ( bool  html5)
pure virtual

Gets the html string which contains data and some formats in this cell.

Parameters
html5Indicates whether the value is compatible for html5
Returns

◆ GetIComment()

virtual intrusive_ptr<Aspose::Cells::IComment> Aspose::Cells::ICell::GetIComment ( )
pure virtual

Gets the comment of this cell.

If there is no comment applies to the cell, returns null.

◆ GetIConditionalFormattingResult()

virtual intrusive_ptr<Aspose::Cells::IConditionalFormattingResult> Aspose::Cells::ICell::GetIConditionalFormattingResult ( )
pure virtual

Get the result of the conditional formatting.

Returns null if no conditional formatting is applied to this cell,

◆ GetIFontSetting()

virtual intrusive_ptr<Aspose::Cells::IFontSetting> Aspose::Cells::ICell::GetIFontSetting ( Aspose::Cells::Systems::Int32  startIndex,
Aspose::Cells::Systems::Int32  length 
)
pure virtual

Returns a Characters object that represents a range of characters within the cell text.

Parameters
startIndexThe index of the start of the character.
lengthThe number of characters.
Returns
Characters object.

This method only works on cell with string value.

[C++]
excel->GetIWorksheets()->GetObjectByIndex(0)->GetICells()->GetObjectByIndex(new String("A1"))->PutValue((StringPtr)new String("Helloworld"));
excel->GetIWorksheets()->GetObjectByIndex(0)->GetICells()->GetObjectByIndex(new String("A1"))->GetIFontSetting(5, 5)->GetIFont()->SetIsBold(true);
excel->GetIWorksheets()->GetObjectByIndex(0)->GetICells()->GetObjectByIndex(new String("A1"))->GetIFontSetting(5, 5)->GetIFont()->SetColor(Color::GetBlue());

◆ GetIFontSettings() [1/2]

virtual intrusive_ptr<Aspose::Cells::Systems::Array1D<Aspose::Cells::IFontSetting*> > Aspose::Cells::ICell::GetIFontSettings ( )
pure virtual

Returns all Characters objects that represents a range of characters within the cell text.

Returns
All Characters objects

◆ GetIFontSettings() [2/2]

virtual intrusive_ptr<Aspose::Cells::Systems::Array1D<Aspose::Cells::IFontSetting*> > Aspose::Cells::ICell::GetIFontSettings ( bool  flag)
pure virtual

Returns all Characters objects that represents a range of characters within the cell text.

Parameters
flagIndicates whether applying table style to the cell if the cell is in the table.
Returns
All Characters objects

◆ GetIFormatConditions()

virtual intrusive_ptr<Aspose::Cells::Systems::Array1D<Aspose::Cells::IFormatConditionCollection*> > Aspose::Cells::ICell::GetIFormatConditions ( )
pure virtual

Gets format conditions which applies to this cell.

Returns
Returns FormatConditionCollection object

◆ GetIntValue()

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::ICell::GetIntValue ( )
pure virtual

Gets the integer value contained in the cell.

◆ GetIPrecedents()

virtual intrusive_ptr<Aspose::Cells::IReferredAreaCollection> Aspose::Cells::ICell::GetIPrecedents ( )
pure virtual

Gets all cells or ranges which this cell's formula depends on.

Returns
Returns all cells or ranges.

Returns null if this is not a formula cell.

[C++]
intrusive_ptr<IWorkbook> workbook = Factory::CreateIWorkbook();
intrusive_ptr<ICells> cells = workbook->GetIWorksheets()->GetObjectByIndex(0)->GetICells();
cells->GetObjectByIndex(new String("A1"))->SetFormula(new String("= B1 + SUM(B1:B10) + [Book1.xls]Sheet1!A1"));
intrusive_ptr<IReferredAreaCollection> areas = cells->GetObjectByIndex(new String("A1"))->GetIPrecedents();
for (int i = 0; i < areas->GetCount(); i++)
{
intrusive_ptr<IReferredArea> area = areas->GetObjectByIndex(i);
StringBuilderPtr stringBuilder = new StringBuilder();
if (area->IsExternalLink())
{
stringBuilder->Append((StringPtr)new String("["));
stringBuilder->Append(area->GetExternalFileName());
stringBuilder->Append((StringPtr)new String("]"));
}
stringBuilder->Append(area->GetSheetName());
stringBuilder->Append((StringPtr)new String("!"));
stringBuilder->Append(ICellsHelper::CellIndexToName(area->GetStartRow(), area->GetStartColumn()));
if (area->IsArea())
{
stringBuilder->Append((StringPtr)new String(":"));
stringBuilder->Append(ICellsHelper::CellIndexToName(area->GetEndRow(), area->GetEndColumn()));
}
Console::WriteLine(stringBuilder->ToString()); }
workbook->Save(new String("D:\\Book2.xls"));

◆ GetIStyle() [1/2]

virtual intrusive_ptr<Aspose::Cells::IStyle> Aspose::Cells::ICell::GetIStyle ( )
pure virtual

Gets the cell style.

Returns
Style object.

To change the style of the cell, please call SetIStyle() method of ICell after changing the style.

◆ GetIStyle() [2/2]

virtual intrusive_ptr<Aspose::Cells::IStyle> Aspose::Cells::ICell::GetIStyle ( bool  checkBorders)
pure virtual

If checkBorders is true, check whether other cells' borders will effect the style of this cell.

Parameters
checkBordersCheck other cells' borders
Returns
Style object.

◆ GetITable()

virtual intrusive_ptr<Aspose::Cells::Tables::IListObject> Aspose::Cells::ICell::GetITable ( )
pure virtual

Gets the table which contains this cell.

Returns

◆ GetIValidation()

virtual intrusive_ptr<Aspose::Cells::IValidation> Aspose::Cells::ICell::GetIValidation ( )
pure virtual

Gets the validation applied to this cell.

Returns

◆ GetIWorksheet()

virtual intrusive_ptr<Aspose::Cells::IWorksheet> Aspose::Cells::ICell::GetIWorksheet ( )
pure virtual

Gets the parent worksheet.

◆ GetLeafs() [1/2]

virtual intrusive_ptr<Aspose::Cells::Systems::Collections::IEnumerator> Aspose::Cells::ICell::GetLeafs ( )
pure virtual

Get all cells which will be updated when this cell is modified. This method can only work after calling CalculateFormula method of IWorkbook.

◆ GetLeafs() [2/2]

virtual intrusive_ptr<Aspose::Cells::Systems::Collections::IEnumerator> Aspose::Cells::ICell::GetLeafs ( bool  recursive)
pure virtual

Get all cells which will be updated when this cell is modified.

Parameters
recursiveWhether returns those leafs which do not reference to this cell directly but reference to other leafs of this cell's

◆ GetMergedIRange()

virtual intrusive_ptr<Aspose::Cells::IRange> Aspose::Cells::ICell::GetMergedIRange ( )
pure virtual

Returns a IRange object which represents a merged range.

Returns
IRange object. Null if this cell is not merged.

◆ GetName()

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::ICell::GetName ( )
pure virtual

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.

◆ GetNumberCategoryType()

virtual Aspose::Cells::NumberCategoryType Aspose::Cells::ICell::GetNumberCategoryType ( )
pure virtual

Represents the category type of this cell's number formatting.

◆ GetPrecedentsInCalculation()

virtual intrusive_ptr<Aspose::Cells::Systems::Collections::IEnumerator> Aspose::Cells::ICell::GetPrecedentsInCalculation ( )
pure virtual

Gets all precedents(reference to cells in current workbook) used by this cell's formula while calculating it.

Returns
Enumerator to enumerate all references(ReferredArea)

◆ GetR1C1Formula()

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::ICell::GetR1C1Formula ( )
pure virtual

Gets a R1C1 formula of the ICell

◆ GetRow()

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::ICell::GetRow ( )
pure virtual

Gets row number (zero based) of the cell.

Cell row number

◆ GetSharedStyleIndex()

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::ICell::GetSharedStyleIndex ( )
pure virtual

Gets cell's shared style index in the style pool.

◆ GetStringValue() [1/2]

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::ICell::GetStringValue ( Aspose::Cells::CellValueFormatStrategy  formatStrategy)
pure virtual

Gets the string value by specific formatted strategy.

Parameters
formatStrategyThe formatted strategy.
Returns

◆ GetStringValue() [2/2]

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::ICell::GetStringValue ( )
pure virtual

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()

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::ICell::GetStringValueWithoutFormat ( )
pure virtual

Gets cell's value as string without any format.

◆ GetType()

virtual Aspose::Cells::CellValueType Aspose::Cells::ICell::GetType ( )
pure virtual

Represents cell value type.

◆ GetValidationValue()

virtual bool Aspose::Cells::ICell::GetValidationValue ( )
pure virtual

Gets the value of validation which applied to this cell.

Returns

◆ GetValue()

virtual intrusive_ptr<Aspose::Cells::Systems::Object> Aspose::Cells::ICell::GetValue ( )
pure virtual

Gets the value contained in this cell.

Possible type:

null,

Boolean,

DateTime,

Double,

Integer

String.

◆ GetWidthOfValue()

virtual Aspose::Cells::Systems::Int32 Aspose::Cells::ICell::GetWidthOfValue ( )
pure virtual

Gets the width of the value in unit of pixels.

Returns

◆ IsArrayFormula()

virtual bool Aspose::Cells::ICell::IsArrayFormula ( )
pure virtual

Indicates whether the cell formula is an array formula.

◆ IsArrayHeader()

virtual bool Aspose::Cells::ICell::IsArrayHeader ( )
pure virtual

Indicates the cell's formula is and array formula and it is the first cell of the array.

◆ IsErrorValue()

virtual bool Aspose::Cells::ICell::IsErrorValue ( )
pure virtual

Checks if a formula can properly evaluate a result.

Also applies to formula cell to check the calculated result

◆ IsFormula()

virtual bool Aspose::Cells::ICell::IsFormula ( )
pure virtual

Represents if the specified cell contains formula.

◆ IsInArray()

virtual bool Aspose::Cells::ICell::IsInArray ( )
pure virtual

Indicates whether the cell formula is an array formula.

◆ IsInTable()

virtual bool Aspose::Cells::ICell::IsInTable ( )
pure virtual

◆ IsMerged()

virtual bool Aspose::Cells::ICell::IsMerged ( )
pure virtual

Checks if a cell is part of a merged range or not.

◆ IsNumericValue()

virtual bool Aspose::Cells::ICell::IsNumericValue ( )
pure virtual

Indicates whether the inner value of this cell is numeric(int, double and datetime)

Also applies to formula cell to check the calculated result

◆ IsRichText()

virtual bool Aspose::Cells::ICell::IsRichText ( )
pure virtual

Indicates whether the cell string value is a rich text.

◆ IsSharedFormula()

virtual bool Aspose::Cells::ICell::IsSharedFormula ( )
pure virtual

Indicates whether the cell formula is part of shared formula.

◆ IsStyleSet()

virtual bool Aspose::Cells::ICell::IsStyleSet ( )
pure virtual

Indicates if the cell's style is set. If return false, it means this cell has a default cell format.

◆ IsTableFormula()

virtual bool Aspose::Cells::ICell::IsTableFormula ( )
pure virtual

Indicates whether this cell is part of table formula.

◆ PutValue() [1/8]

virtual void Aspose::Cells::ICell::PutValue ( bool  boolValue)
pure virtual

Puts an boolean value into the cell.

Parameters
boolValue

◆ PutValue() [2/8]

virtual void Aspose::Cells::ICell::PutValue ( Aspose::Cells::Systems::Int32  intValue)
pure virtual

Puts an integer value into the cell.

Parameters
intValueInput value

◆ PutValue() [3/8]

virtual void Aspose::Cells::ICell::PutValue ( Aspose::Cells::Systems::Double  doubleValue)
pure virtual

Puts a double value into the cell.

Parameters
doubleValueInput value

◆ PutValue() [4/8]

virtual void Aspose::Cells::ICell::PutValue ( intrusive_ptr< Aspose::Cells::Systems::String >  stringValue,
bool  isConverted,
bool  setStyle 
)
pure virtual

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
stringValueInput value
isConvertedTrue: converted to other data type if appropriate.
setStyleTrue: set the number format to cell's style when converting to other data type

◆ PutValue() [5/8]

virtual void Aspose::Cells::ICell::PutValue ( intrusive_ptr< Aspose::Cells::Systems::String >  stringValue,
bool  isConverted 
)
pure virtual

Puts a string value into the cell and converts the value to other data type if appropriate.

Parameters
stringValueInput value
isConvertedTrue: converted to other data type if appropriate.

◆ PutValue() [6/8]

virtual void Aspose::Cells::ICell::PutValue ( intrusive_ptr< Aspose::Cells::Systems::String >  stringValue)
pure virtual

Puts a string value into the cell.

Parameters
stringValueInput value

◆ PutValue() [7/8]

virtual void Aspose::Cells::ICell::PutValue ( intrusive_ptr< Aspose::Cells::Systems::DateTime >  dateTime)
pure virtual

Puts a DateTime value into the cell.

Parameters
dateTimeInput value

◆ PutValue() [8/8]

virtual void Aspose::Cells::ICell::PutValue ( intrusive_ptr< Aspose::Cells::Systems::Object >  objectValue)
pure virtual

Puts an object value into the cell.

Parameters
objectValueinput value

◆ RemoveArrayFormula()

virtual void Aspose::Cells::ICell::RemoveArrayFormula ( bool  leaveNormalFormula)
pure virtual

Remove array formula.

Parameters
leaveNormalFormulaTrue represents converting the array formula to normal formula.

◆ SetArrayFormula() [1/2]

virtual void Aspose::Cells::ICell::SetArrayFormula ( intrusive_ptr< Aspose::Cells::Systems::String >  arrayFormula,
Aspose::Cells::Systems::Int32  rowNumber,
Aspose::Cells::Systems::Int32  columnNumber,
bool  isR1C1,
bool  isLocal 
)
pure virtual

Sets an array formula to a range of cells.

Parameters
arrayFormulaArray formula.
rowNumberNumber of rows to populate result of the array formula.
columnNumberNumber of columns to populate result of the array formula.
isR1C1whether the formula is R1C1 formula
isLocalwhether the formula is locale formatted

◆ SetArrayFormula() [2/2]

virtual void Aspose::Cells::ICell::SetArrayFormula ( intrusive_ptr< Aspose::Cells::Systems::String >  arrayFormula,
Aspose::Cells::Systems::Int32  rowNumber,
Aspose::Cells::Systems::Int32  columnNumber 
)
pure virtual

Sets an array formula(legacy array formula entered via CTRL+SHIFT+ENTER in ms excel) to a range of cells.

Parameters
arrayFormulaArray formula.
rowNumberNumber of rows to populate result of the array formula.
columnNumberNumber of columns to populate result of the array formula.

◆ SetFormula() [1/3]

virtual void Aspose::Cells::ICell::SetFormula ( intrusive_ptr< Aspose::Cells::Systems::String >  value)
pure virtual

Gets or sets a formula of the ICell

A formula string always begins with an equal sign (=). And please always use comma(,) as parameters delimiter, such as "=SUM(A1, E1, H2)".

User can set any formula in Workbook designer file. Aspose.Cells will keep all the formulas. If user use this property to set a formula to a cell, major part of Workbook built-in functions is supported. And more is coming. If you have any special need for Workbook built-in functions, please let us know.

[C++]
intrusive_ptr<IWorkbook> excel = Factory::CreateIWorkbook();
intrusive_ptr<ICells> cells = excel->GetIWorksheets()->GetObjectByIndex(0)->GetICells();
cells->GetObjectByIndex(new String("B6"))->SetFormula(new String("=SUM(B2:B5, E1) + sheet2!A1"));

◆ SetFormula() [2/3]

virtual void Aspose::Cells::ICell::SetFormula ( intrusive_ptr< Aspose::Cells::Systems::String >  formula,
intrusive_ptr< Aspose::Cells::Systems::Object >  value 
)
pure virtual

Set the formula and the value of the formula.

Parameters
formulaThe formula.
valueThe value of the formula.

◆ SetFormula() [3/3]

virtual void Aspose::Cells::ICell::SetFormula ( intrusive_ptr< Aspose::Cells::Systems::String >  formula,
bool  isR1C1,
bool  isLocal,
intrusive_ptr< Aspose::Cells::Systems::Object >  value 
)
pure virtual

Set the formula and the value of the formula.

Parameters
formulaThe formula.
isR1C1Whether the formula is R1C1 formula.
isLocalWhether the formula is locale formatted.
valueThe value of the formula.

◆ SetFormulaLocal()

virtual void Aspose::Cells::ICell::SetFormulaLocal ( intrusive_ptr< Aspose::Cells::Systems::String >  value)
pure virtual

Get the locale formatted formula of the cell.

◆ SetHtmlString()

virtual void Aspose::Cells::ICell::SetHtmlString ( intrusive_ptr< Aspose::Cells::Systems::String >  value)
pure virtual

Sets the html string which contains data and some formats in this cell.

◆ SetIFontSettings()

virtual void Aspose::Cells::ICell::SetIFontSettings ( intrusive_ptr< Aspose::Cells::Systems::Array1D< Aspose::Cells::IFontSetting *>>  characters)
pure virtual

Sets rich text format of the cell.

Parameters
charactersAll Characters objects.

◆ SetIStyle() [1/3]

virtual void Aspose::Cells::ICell::SetIStyle ( intrusive_ptr< Aspose::Cells::IStyle style)
pure virtual

Sets the cell style.

Parameters
styleThe cell style.

If the border settings are changed, the border of adjust cells will be updated too.

◆ SetIStyle() [2/3]

virtual void Aspose::Cells::ICell::SetIStyle ( intrusive_ptr< Aspose::Cells::IStyle style,
bool  explicitFlag 
)
pure virtual

Apply the cell style.

Parameters
styleThe cell style.
explicitFlagTrue, only overwriting formatting which is explicitly set.

◆ SetIStyle() [3/3]

virtual void Aspose::Cells::ICell::SetIStyle ( intrusive_ptr< Aspose::Cells::IStyle style,
intrusive_ptr< Aspose::Cells::IStyleFlag flag 
)
pure virtual

Apply the cell style.

Parameters
styleThe cell style.
flagThe style flag.

◆ SetR1C1Formula()

virtual void Aspose::Cells::ICell::SetR1C1Formula ( intrusive_ptr< Aspose::Cells::Systems::String >  value)
pure virtual

Sets a R1C1 formula of the ICell

◆ SetSharedFormula() [1/2]

virtual void Aspose::Cells::ICell::SetSharedFormula ( intrusive_ptr< Aspose::Cells::Systems::String >  sharedFormula,
Aspose::Cells::Systems::Int32  rowNumber,
Aspose::Cells::Systems::Int32  columnNumber,
bool  isR1C1,
bool  isLocal 
)
pure virtual

Sets a formula to a range of cells.

Parameters
sharedFormulaShared formula.
rowNumberNumber of rows to populate the formula.
columnNumberNumber of columns to populate the formula.
isR1C1whether the formula is R1C1 formula
isLocalwhether the formula is locale formatted

◆ SetSharedFormula() [2/2]

virtual void Aspose::Cells::ICell::SetSharedFormula ( intrusive_ptr< Aspose::Cells::Systems::String >  sharedFormula,
Aspose::Cells::Systems::Int32  rowNumber,
Aspose::Cells::Systems::Int32  columnNumber 
)
pure virtual

Sets a formula to a range of cells.

Parameters
sharedFormulaShared formula.
rowNumberNumber of rows to populate the formula.
columnNumberNumber of columns to populate the formula.

◆ SetValue()

virtual void Aspose::Cells::ICell::SetValue ( intrusive_ptr< Aspose::Cells::Systems::Object >  value)
pure virtual

Gets the value contained in this cell.

Possible type:

null,

Boolean,

DateTime,

Double,

Integer

String.

◆ ToString()

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::ICell::ToString ( )
pure virtual

Returns a string represents the current Cell object.

Returns