See attached sample: a cell is merged over three columns, and the text contains a linebreak. AsposeCellsTest.zip (4.8 KB)
I call “AutoSizeRows” with “AutoFitterOptions.AutoFitMergedCellsType” (https://docs.aspose.com/cells/net/autofit-rows-for-merged-cells/. The property “Style.IsTextWrapped” is also set to “true”.
But in the resulting document, the row still has the default height.
The same happens if the cell content has no linebreak, but is long enough to wrap.
When a cell spans multiple rows, the row height is calculated properly.
Attached sample is a .NET5 project, but the issue happens for us in a .NET 4.8 application.
The attribute “customHeight=1” seems to make the difference - I edited the xml file create by Aspose and added this snippet, and the result looked fine in Excel.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.