Today we faced with another one. If we set a style with font name (for example) "Calibri" auto fit also does not work properly if zoom < 100 is set. I attached the sample project for your convinience. The exported document contains 2 columns: for the 1st one "Calibri" font is set and "Arial" font - for the 2nd. We call "AutoFitColumn" method for both columns and it works fine with "Arial" but does not with "Calibri" font. This behavior is observed if zoom < 100 only.
I can find the issue as you have mentioned. The auto-fitting of columns are not applied when the zoom is set less than 100 and a style (with font "Calibri") is applied to a range of cells.
Sample code:
using System.Diagnostics; using System.IO; using Aspose.Cells;
namespace AsposeZoomAutofitIssue { class Program { private const string WorksheetName = "Test";
static void Main() { var workbook = ExportTable();
private static Workbook ExportTable() { var workbook = new Workbook(); workbook.Worksheets.Clear(); Worksheet worksheet = workbook.Worksheets.Add(WorksheetName);
worksheet.Cells.ImportArray(new[] {"Col", "Col2"}, 0, 0, false); worksheet.Cells.ImportArray(new[] {"SAMPLE TEXT IN UPPER CASE", "a"}, 1, 0, false); worksheet.Cells.ImportArray(new[] { "SAMPLE TEXT IN UPPER CASE SAMPLE TEXT IN UPPER CASE - CALIBRI", "SAMPLE TEXT IN UPPER CASE SAMPLE TEXT IN UPPER CASE - ARIAL" }, 2, 0, false); worksheet.Cells.ImportArray(new[] { "SAMPLE TEXT IN UPPER CASE SAMPLE ", "b"}, 3, 0, false);