How to apply optimal row and column width when opening a Calc document?

We generate reports as spreadsheets (by directly modifying the content.xml of a template document). Some of the cells can have multiple lines, and the cell contents vary in width as well. All columns and rows are set to use the optimal width/height, and I would like the display to adjust automatically when the user opens the document.

The content.xml styles contain

<style:style style:name="ro1" style:family="table-row">
   <style:table-row-properties fo:break-before="auto" style:use-optimal-row-height="true"/>

(I have removed the style:row-height attribute.)

Whatever I try, I cannot get LO to recalculate the optimal row heights when the document is opened. I’m not even sure if this is possible; I’ve seen a few related bugs: #62268, #62361.

The only thing I can think of is to create a macro that sets optimal widths/heights and bind it to a keyboard shortcut. Is there any other way to achieve this?

Have you tested with the option Menu/Tools/Options/Load+Save/Formula - Recalculation on File Load for ODF?

I have now; there’s no change in the col/row display.