How to use Cells NumberFormat property?

hi. I'm Korean developer.
I use bad English. sorry.

this is my code. (by C#)
------------------------------
try
{
DataTable dt = new DataTable();
dt.Columns.Add("NAME");
dt.Columns.Add("POINT", typeof(double));

dt.Rows.Add(new object[] { "1", 20333.01 });
dt.Rows.Add(new object[] { "2", 20.02 });
dt.Rows.Add(new object[] { "3", 20333 });

ExcelEngine oExcel = new ExcelEngine();
IApplication oApp = oExcel.Excel;
IWorkbook oBook = oApp.Workbooks.Create(1);

IWorksheet oSheet = oBook.Worksheets[0];
oSheet.ImportDataTable(dt, true, 1, 1, false);
oSheet.Columns[1].CellStyle.NumberFormat = "#,##0.##";
oBook.SaveAs("test.xls");
}
catch {}
------------------------------

I want to print like under.(in excel)

1 20,333.01
2 20.02
3 20,333

but when use this code print like under.(in excel)

1 20,333.01
2 20.02
3 20,333.

I don't know why printed point in 3rd row.

how to fix my code. help!!!
thank you :)


4 Replies

JK jin-hyung kim December 27, 2011 08:56 AM UTC

sorry. version is 6.2.0.40



SR Sridhar Syncfusion Team December 28, 2011 12:57 PM UTC

Hi Jin-hyung Kim,

Thank you for using Syncfusion Products.

By default with MS Excel for the given Number Format (#,##0.##) it shows the values as “20,333.” XlsIO also follows the same behavior of an MS Excel and we are not able to affect the behavior of an MS Excel with XlsIO. We have taken the screen video of testing done at our side with MS Excel and placed in the below link for your reference.

Video Link:
F102109_Video.zip

Please take a look at the video and let us know if this helps you. Please revert back to us if you have any concerns.

Please let us know if you require any further clarifications.

Regards,
Sridhar.S




JK jin-hyung kim December 29, 2011 03:02 AM UTC

hi. Sridhar.S

Thank you for your answer.

I want to watch your video.
but the video's link is not work.

please fix video's link. :)



SR Sridhar Syncfusion Team December 29, 2011 01:16 PM UTC

Hi Jin-hyung Kim,

Thank you for the update.

Please get the above reported video from the following link.

Video Link:

http://www.syncfusion.com/downloads/Support/DirectTrac/88949/F102109_Video1994109193.zip

Please let us know if you require any further clarifications.

Regards,
Sridhar.S



Loader.
Up arrow icon