We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Text formatting fails after CalculateFormula

We are using a danish version (2010) of excel with a formula formatting a date to text. This formatting fails after CalculateFormula has been called. Before calling CalculateFormula the text is correct.


I have attached the excel file, and a code snippet:

using (var stream = File.OpenRead(@“TEST_year.xls”))
{
var workbook = new Workbook(stream);
var worksheet = workbook.Worksheets[“Test”];
// A1: 31-12-2015
var cell = worksheet.Cells[“A2”]; // Formular: =“Text before - " & TEKST(A1;“dd.mm.åååå”) & " - text after”
Console.WriteLine("Before CalculateFormula: " + cell.StringValue); // prints: Text before - 31.12.2015 - text after
workbook.CalculateFormula(false);
Console.WriteLine("After CalculateFormula: " + cell.StringValue); // prints: Text before - 31.12.åååå - text after
}

I have tested with latest version of Aspose.cells v8.7

Hi,


Thanks for the template file and sample code.

After an initial test, I observed the issue as you mentioned by using your sample code with your template file. I found an issue with text formatting after calling Workbook.CalculateFormula for danish formula. When I simply add the formula “TEXT(A1,“dd.mm.åååå”)” to some other cell in MS Excel manually, MS Excel calculates it fine but Aspose.Cells calculates it as “31.12.åååå” even after setting the Workbook’s region to Denmark.
e.g
Sample code:

var workbook = new Workbook(“e:\test2\TEST_Year.xls”);
workbook.Settings.Region = CountryCode.Denmark;
var worksheet = workbook.Worksheets[“Test”];
// A1: 31-12-2015
var cell = worksheet.Cells[“A2”]; // Formular: =“Text before - " & TEKST(A1;“dd.mm.åååå”) & " - text after”
Console.WriteLine("Before CalculateFormula: " + cell.StringValue); // prints: Text before - 31.12.2015 - text after
workbook.CalculateFormula();
Console.WriteLine("After CalculateFormula: " + cell.StringValue); // prints: Text before - 31.12.åååå - te

I have logged a ticket with an id “CELLSNET-44244” for your issue. We will check if we could figure your issue soon.

Once we have any update on it, we will let you know here.

Thank you.

Hi,

Thanks for using Aspose.Cells.

It is to inform you that we have fixed your issue CELLSNET-44244 now. We will soon provide the fix after performing QA and including other enhancements and fixes.

The issues you have found earlier (filed as CELLSNET-44244) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.