Cell.PutValue

PutValue(bool)

Puts a boolean value into the cell.

public void PutValue(bool boolValue)
ParameterTypeDescription
boolValueBoolean

See Also


PutValue(int)

Puts an integer value into the cell.

public void PutValue(int intValue)
ParameterTypeDescription
intValueInt32Input value

See Also


PutValue(double)

Puts a double value into the cell.

public void PutValue(double doubleValue)
ParameterTypeDescription
doubleValueDoubleInput value

See Also


PutValue(string, bool, bool)

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.

public void PutValue(string stringValue, bool isConverted, bool setStyle)
ParameterTypeDescription
stringValueStringInput value
isConvertedBooleanTrue: converted to other data type if appropriate.
setStyleBooleanTrue: set the number format to cell’s style when converting to other data type

See Also


PutValue(string, bool)

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

public void PutValue(string stringValue, bool isConverted)
ParameterTypeDescription
stringValueStringInput value
isConvertedBooleanTrue: converted to other data type if appropriate.

See Also


PutValue(string)

Puts a string value into the cell.

public void PutValue(string stringValue)
ParameterTypeDescription
stringValueStringInput value

See Also


PutValue(DateTime)

Puts a DateTime value into the cell.

public void PutValue(DateTime dateTime)
ParameterTypeDescription
dateTimeDateTimeInput 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

This example shows how to set DateTime value to a cell and make it be displayed as date time.

[C#]

Workbook excel = new Workbook();
Cells cells = excel.Worksheets[0].Cells;

//Put date time into a cell
Cell cell = cells[0, 0];
cell.PutValue(new DateTime(2023, 5, 15));
Style style = cell.GetStyle(false);
style.Number = 14;
cell.SetStyle(style);

See Also


PutValue(object)

Puts an object value into the cell.

public void PutValue(object objectValue)
ParameterTypeDescription
objectValueObjectinput value

See Also