Aspose::Cells::Cell::PutValue method

Cell::PutValue(bool) method

Puts a boolean value into the cell.

void Aspose::Cells::Cell::PutValue(bool boolValue)
ParameterTypeDescription
boolValuebool

See Also

Cell::PutValue(int32_t) method

Puts an integer value into the cell.

void Aspose::Cells::Cell::PutValue(int32_t intValue)
ParameterTypeDescription
intValueint32_tInput value

See Also

Cell::PutValue(double) method

Puts a double value into the cell.

void Aspose::Cells::Cell::PutValue(double doubleValue)
ParameterTypeDescription
doubleValuedoubleInput value

See Also

Cell::PutValue(const U16String&, bool, bool) method

Puts a value into the cell, if appropriate the value will be converted to other data type and cell’s number format will be reset.

void Aspose::Cells::Cell::PutValue(const U16String &stringValue, bool isConverted, bool setStyle)
ParameterTypeDescription
stringValueconst U16String&Input value
isConvertedboolTrue: converted to other data type if appropriate.
setStyleboolTrue: set the number format to cell’s style when converting to other data type

See Also

Cell::PutValue(const char16_t*, bool, bool) method

Puts a value into the cell, if appropriate the value will be converted to other data type and cell’s number format will be reset.

void Aspose::Cells::Cell::PutValue(const char16_t *stringValue, bool isConverted, bool setStyle)
ParameterTypeDescription
stringValueconst char16_t*Input value
isConvertedboolTrue: converted to other data type if appropriate.
setStyleboolTrue: set the number format to cell’s style when converting to other data type

See Also

Cell::PutValue(const U16String&, bool) method

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

void Aspose::Cells::Cell::PutValue(const U16String &stringValue, bool isConverted)
ParameterTypeDescription
stringValueconst U16String&Input value
isConvertedboolTrue: converted to other data type if appropriate.

See Also

Cell::PutValue(const char16_t*, bool) method

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

void Aspose::Cells::Cell::PutValue(const char16_t *stringValue, bool isConverted)
ParameterTypeDescription
stringValueconst char16_t*Input value
isConvertedboolTrue: converted to other data type if appropriate.

See Also

Cell::PutValue(const U16String&) method

Puts a string value into the cell.

void Aspose::Cells::Cell::PutValue(const U16String &stringValue)
ParameterTypeDescription
stringValueconst U16String&Input value

See Also

Cell::PutValue(const char16_t*) method

Puts a string value into the cell.

void Aspose::Cells::Cell::PutValue(const char16_t *stringValue)
ParameterTypeDescription
stringValueconst char16_t*Input value

See Also

Cell::PutValue(const Date&) method

Puts a DateTime value into the cell.

void Aspose::Cells::Cell::PutValue(const Date &dateTime)
ParameterTypeDescription
dateTimeconst Date&Input value

Remarks

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.

Examples

Aspose::Cells::Startup();
Workbook excel;
Cells cells = excel.GetWorksheets().Get(0).GetCells();

//Put date time into a cell
Cell cell = cells.Get(0, 0);
cell.PutValue(Date{ 2023, 5, 15 });
Style style = cell.GetStyle(false);
style.SetNumber(14);
cell.SetStyle(style);
Aspose::Cells::Cleanup();

See Also