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.

Formatting cell

Thread ID:

Created:

Updated:

Platform:

Replies:

106980 Feb 5,2013 10:32 AM Feb 15,2013 03:51 AM Windows Forms 5
loading
Tags: XlsIO
Ricerca Sviluppo
Asked On February 5, 2013 10:32 AM

Hello,

I would like to format a cell with the format hh:mm with no limit like 0-11 or 0-23.

In the documentation I cannot see this kind of format, so how can I use it?

Thank you,

Best regards

Mirko Salvia

 


Manikandan M [Syncfusion]
Replied On February 8, 2013 04:33 AM

Hi Ricerca,

Thanks for using Syncfusion products.

We have created the simplified sample to set the 'NumberFormat' of the cell as 'hh:mm' and have attached the same in the below link. Please make use of this and let us know if this helps you.

Sample link:TimeFormat.zip

Code snippet:
           //setting the format to cell
            sheet[1, 1].NumberFormat = "hh:mm";

Thank you very much for your patience.Please let us know if you need any clarifications.

Thanks,
Manikandan M.

Ricerca Sviluppo
Replied On February 8, 2013 09:48 AM

Hi Manikandan,

I tried you solution and it works, but there is still a little problem on the cell.

I would like to represent this cell like a number so I would like to align it on the right, but it seems like it is formatted like "text" so it is aligned on the left.

 

Thank you for your suggestions.

Best regards,

Mirko Salvia


Manikandan M [Syncfusion]
Replied On February 12, 2013 06:10 AM

Hi Mirko Salvia,

Thanks for your patience.

The report issue can be resolved by setting the date time value to sheet range. We have modified the above provided sample and update the same in the below link. Please make use of this and let us know if this helps you.

Sample link:TimeFormat_Modified.zip

Code snippet:
           //setting the value to first cell
            IRange range1 = sheet["A1"];
            range1.DateTime = new DateTime(2013, 1, 31, 11, 10, 0);
            sheet[1, 1].NumberFormat = "hh:mm";

We highly regret for the inconvenience caused.

Please let us know if you need any clarifications.

Thanks,
Manikandan M.

Ricerca Sviluppo
Replied On February 14, 2013 10:03 AM

Thank you for your suggestion!

I will try it as soon as I can.

I will let you know if I will solve the problem.

Thank you

 

Best regards,

Mirko Salvia


Manikandan M [Syncfusion]
Replied On February 15, 2013 03:51 AM

Hi Mirko,

Thanks for the update.

Take your time on testing the provided solution and please let us know if this helps you.

Thanks,
Manikandan M.

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.

;