I have a multiline wrapped text, which I want to autofit in 1 column. My code to demonstrate is following:
var xls = new XlsFile(1, true);
TFlxApplyFormat apply = new TFlxApplyFormat();
apply.WrapText = true;
TFlxFormat format = xls.GetDefaultFormat;
format.WrapText = true;
xls.SetCellFormat(1, 1, 1, 1, format, apply);
xls.SetCellValue(1, 1, @"First long line of text
Second long line of text
Third long line of text
Fourth long line of text
Fifth long line of text
Sixth long line of text
Seventh long line of text");
xls.AutofitCol(1, false, 1.2);
When I open the created file, the width of the first column is 146.29. It looks like the AutofitCol function does not consider wrapping and take the whole text like one line.
When I let Excel to autofit col, the width is 21.57 and this is what I want.
What I am doing wrong?
Thank you in advance
I have sent you an email, I would like to get the version you mentioned.
thank you very much for this version, so far it works perfect.