Custom Formatting


#1

As a follow-on to my previous post, I have a question about custom formatting. I’m sure you are quite familiar with the formatting options in Excel as well as those that can be used in .NET, in say a DataGrid. Let’s suppose I want to specify a custom format for a percentage value, say 3.2% (equivalent to 0.032). Now, in Excel, I could use the preset format option of: 0.0%;[Red]-0.0% to yield 3.2%. If my value were -0.032, then Excel would display it as (3.2%) in red. I can likewise specify a format for the value 0.032 to control how it will display in an ASP.NET DataGrid by using something like: {0:#0.0%}.

Is there any property I can set via Aspose.Excel to control the format of an Excel cell value via code? Again, I’ve reviewed the Aspose.Excel documentation and could not find anything that addressed custom formatting.

Thanks!


#2


Dear Nathan,

It is second time to request to support custom formatting so we’d love to do that.

Unfortunately we still haven’t figured out an API which allows you to easy to use and at the same time it is also flexible enough.

You know, it’s quite easy to set custom formatting manually in Excel but it’s not so straightforward to do that programmably.

So tt’s greatly appreciated if you can suggest what a good API looks like.


#3


Dear Nathan,

We decide to add a CellFormat.CustomNumberFormatString property, which allows you to customize the cell format.

Is it OK for you?

It will be done within 1-2 weeks please let me know if you need it immediately when it is available.