We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to use Cells NumberFormat property?

Thread ID:

Created:

Updated:

Platform:

Replies:

102109 Dec 27,2011 03:55 AM Dec 29,2011 08:16 AM ASP.NET Web Forms (Classic) 4
loading
Tags: XlsIO
jin-hyung kim
Asked On December 27, 2011 03:55 AM

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 :)


jin-hyung kim
Replied On December 27, 2011 03:56 AM

sorry. version is 6.2.0.40


Sridhar [Syncfusion]
Replied On December 28, 2011 07:57 AM

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



jin-hyung kim
Replied On December 28, 2011 10:02 PM

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. :)


Sridhar [Syncfusion]
Replied On December 29, 2011 08:16 AM

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



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;