Hi,
Error AutoFit:
Please see the following code. Please add the red line, it will work fine.
workbook.CalculateFormula();
C#
Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets[0];
Aspose.Cells.Style s = sheet.Cells[“B4”].GetStyle();
s.Custom = “#,###,###,###.00”;
sheet.Cells[“B1”].PutValue(1000);
sheet.Cells[“B1”].SetStyle(s);
sheet.Cells[“B2”].PutValue(2000);
sheet.Cells[“B2”].SetStyle(s);
sheet.Cells[“B3”].PutValue(1000);
sheet.Cells[“B3”].SetStyle(s);
sheet.Cells[“B4”].Formula = “B1B2B3”;
sheet.Cells[“B4”].SetStyle(s);
workbook.CalculateFormula();
sheet.AutoFitColumns();
workbook.Save(HttpContext.Current.Response, “teste.xls”, ContentDisposition.Attachment, new XlsSaveOptions(SaveFormat.Excel97To2003));
HttpContext.Current.Response.End();
Error Convert to Xlsx:I was able to replicate the problem using the code below. I have attached the source and problematic output file.
C#
string filePath = @“F:\Shak-Data-RW\Downloads\Misc\test\TesteAspose\TesteAspose\example.xls”;
Workbook workbook = new Workbook(filePath);
workbook.Save(filePath + “.out.xlsx”);
We have logged this issue in our database. Once, we will fix it or have some update for you, we will let you know asap.
This issue has been logged as CELLSNET-40418