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
 Calcaulate the formula of the cell. More...
 
virtual void Calculate (bool ignoreError, intrusive_ptr< Aspose::Cells::ICustomFunction > customFunction)=0
 Calcaulate 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 a bool value into the cell. More...
 
virtual void PutValue (Aspose::Cells::Systems::Int32 intValue)=0
 Puts an int 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 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. More...
 
virtual Aspose::Cells::Systems::Int32 GetIntValue ()=0
 Gets the int 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 bool value contained in the cell. More...
 
virtual intrusive_ptr< Aspose::Cells::IStyleGetDisplayIStyle ()=0
 Gets the display style of the cell. If the cell is conditional formatted, the display style is not same as the GetIStyle() in ICell. 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 affect 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 or sets 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 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 > GetR1C1Formula ()=0
 Gets an R1C1 formula of the ICell More...
 
virtual void SetR1C1Formula (intrusive_ptr< Aspose::Cells::Systems::String > value)=0
 Sets an R1C1 formula of the ICell 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 > 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 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 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 IsInArray ()=0
 Indicates whether the cell formula is an array formula. More...
 
virtual bool IsInTable ()=0
 Indicates whether this cell is part of table formula. More...
 
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 to a range of cells. More...
 
virtual void RemoveArrayFormula (bool leaveNormalFormula)=0
 Remove array formula. More...
 
virtual void SetAddInFormula (intrusive_ptr< Aspose::Cells::Systems::String > addInFileName, intrusive_ptr< Aspose::Cells::Systems::String > addInFunction)=0
 Sets an Add-In formula to the cell. 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 an IRange object which represents a merged range. More...
 
virtual intrusive_ptr< Aspose::Cells::Systems::String > GetHtmlString ()=0
 Gets and sets the html string which contains data and some formats in this cell. More...
 
virtual void SetHtmlString (intrusive_ptr< Aspose::Cells::Systems::String > value)=0
 Gets and sets the html string which contains data and some formats in this cell. 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 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

Calcaulate 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

Calcaulate 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 ICell object.

◆ Equals()

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 bool 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

◆ GetDisplayIStyle()

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

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

◆ GetDisplayStringValue()

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

Gets the formatted string value of this cell.

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

virtual intrusive_ptr<Aspose::Cells::Systems::String> Aspose::Cells::ICell::GetFormula ( )
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"));

◆ GetHeightOfValue()

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

Gets the height of the value in unit of pixels.

Returns

◆ GetHtmlString()

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

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

◆ 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 IFormatConditionCollection object

◆ GetIntValue()

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

Gets the int 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 affect the style of this cell.

Parameters
checkBordersCheck other cells' borders
Returns

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

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.

◆ GetMergedIRange()

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

Returns an 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.

◆ GetR1C1Formula()

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

Gets an 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

◆ 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.

Only applies to formula cell.

◆ 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

Indicates whether this cell is part of table formula.

◆ IsMerged()

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

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

◆ IsRichText()

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

Indicates whether the cell string value is a rich text.

◆ 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.

◆ PutValue() [1/8]

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

Puts a bool value into the cell.

Parameters
boolValue

◆ PutValue() [2/8]

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

Puts an int 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.

◆ SetAddInFormula()

virtual void Aspose::Cells::ICell::SetAddInFormula ( intrusive_ptr< Aspose::Cells::Systems::String >  addInFileName,
intrusive_ptr< Aspose::Cells::Systems::String >  addInFunction 
)
pure virtual

Sets an Add-In formula to the cell.

Parameters
addInFileNameAdd-In file name.
addInFunctionAdd-In function name.
[C++]
cells->GetObjectByIndex(new String("h11"))->SetAddInFormula(new String("HRVSTTRK.xla"), new String(" = pct_overcut(F3:G3)"));
cells->GetObjectByIndex(new String("h12"))->SetAddInFormula(new String("HRVSTTRK.xla"), new String("=pct_overcut()"));

Add-In file should be placed in the directory or sub-directory of Workbook Add-In library. For example, file name can be "Eurotool.xla" or "solver\solver.xla".

◆ SetArrayFormula()

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 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/2]

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/2]

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.

◆ SetHtmlString()

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

Gets and 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 an R1C1 formula of the ICell

◆ SetSharedFormula()

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.