We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Format Cell as Text

Hi

We have a license of Aspose Cells.

I have a column that has different data types in it -- example of field values:

L112029920200
11200900000434
0-F8702-350027

These values come out of a stored procedure, and I put them into an excel file with aspose. However, since the format is "General", the second number , 11200900000434, gets displayed as scientific notation,

1.12009E+13

And the value ends up being 11200900000000.

How can I format the column to allow multiple data types, and maintain a true representation of the values without scientific notation and the eventual truncation I am seeing?

Thanks

Donny Weltman

Software Developer

Just to point out, I have been creating xls and xlsx, but I believe that if I were creating excel 2010 files, this issue wouldn't come up.

Is there a way to create an excel 2010 file? Saveformat xlsx 2010 or something?

Thanks

Donny

Hi,

You should convert them into string and then place them in your Excel file.

If you want to manually place the number as text then use ’ before it.

e.g

2.05 will become '2.05

And you can use Aspose.Cells to convert all of your placed values into text values.

e.g the following code will convert the value of cell into a string/text value.

cell.PutValue(cell.StringValue);