Style Custom Format Problem!

Since we retrieved the latest hotfix version - (Nov 3rd) - we are now having a problem with values showing up as blank in our worksheets. They are date values, and the style applied to the cell is defined as:



dateStyle = excel.Styles[styleIndex];

dateStyle.Custom = “mm/dd/yyyy”;

dateStyle.Name = “dateStyle”;




Here is how we are putting in the values:


sheet.Cells[rowCounter, col].PutValue(DateTime.Parse(row[“processed”].ToString()));




This was working quite well until we retrieved the latest hotfix. I rolled back the Aspose.Excell.dll to its previous version and it fixes this problem. However, we need a fix that is included in the latest version. Can this be addressed quickly?


Dear Matthew,
Sorry for any inconvenience.
I tested your code with your previous designer file but didn't find the problem. Are you sure that you are uing the latest hotfix v2.4.2?
And could you elaborate your problem and make a simple test to see if the problem still exists?
Excel excel = new Excel();
excel.Open(designerSpreadsheet);

Aspose.Excel.Style dateStyle = excel.Styles[excel.Styles.Add()];

dateStyle.Custom = "mm/dd/yyyy";

dateStyle.Name = "dateStyle";

Worksheet sheet = excel.Worksheets[0];
sheet.Cells[0,0].PutValue(DateTime.Now);
sheet.Cells[0, 0].Style = dateStyle;
excel.Save("book1.xls", SaveType.OpenInExcel, FileFormatType.Default, this.Response);
Thank you very much.

@mbuckleman,
Aspose.Excel is discontinued now and no more development is done for it. A new product Aspose.Cells has replaced it which supports all the legacy features of Aspose.Excel as well as the latest features available in different versions of MS Excel. You can format data using this new product also as shown in the following sample code:

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

// Create directory if it is not already present.
bool IsExists = System.IO.Directory.Exists(dataDir);
if (!IsExists)
    System.IO.Directory.CreateDirectory(dataDir);

// Instantiating a Workbook object
Workbook workbook = new Workbook();

// Adding a new worksheet to the Excel object
int i = workbook.Worksheets.Add();

// Obtaining the reference of the newly added worksheet by passing its sheet index
Worksheet worksheet = workbook.Worksheets[i];

// Adding the current system date to "A1" cell
worksheet.Cells["A1"].PutValue(DateTime.Now);

// Getting the style of A1 cell
Style style = worksheet.Cells["A1"].GetStyle();

// Setting the custom display format to show date as "d-mmm-yy"
style.Custom = "d-mmm-yy";

// Applying the style to A1 cell
worksheet.Cells["A1"].SetStyle(style);

// Adding a numeric value to "A2" cell
worksheet.Cells["A2"].PutValue(20);

// Getting the style of A2 cell
style = worksheet.Cells["A2"].GetStyle();

// Setting the custom display format to show value as percentage
style.Custom = "0.0%";

// Applying the style to A2 cell
worksheet.Cells["A2"].SetStyle(style);

// Adding a numeric value to "A3" cell
worksheet.Cells["A3"].PutValue(2546);

// Getting the style of A3 cell
style = worksheet.Cells["A3"].GetStyle();

// Setting the custom display format to show value as currency
style.Custom = "£#,##0;[Red]$-#,##0";

// Applying the style to A3 cell
worksheet.Cells["A3"].SetStyle(style);

// Saving the Excel file
workbook.Save(dataDir + "book1.out.xls", SaveFormat.Excel97To2003);

Have a look at the following article for more information on formatting the data:
Data Formatting

Here is the link to the latest free trial version of this product:
Aspose.Cells for .NET (Latest Version)

A ruunable solution is available here which can be used to test different features of this product without writing ay code.