Adjust row height to fit text automatically

Hello,
I am creating Odoo - 12 invoice using py3o report engine.
Today I got stuck for atleast 1 hours with wrong row size for fitting text in libreoffice calc 6.

In report template I define product name as variable which fits perfectly as shown below.

image description

But then I print report and got product’s name there might be cases then it’s too long. (Second product’s name doesn’t fit).

image description

Formatting cell and wrapping text helps breaking text into different lines, but row height doesn’t change then printing report.
If I print report then part of text is being cut.

I can change row height manually by dragging row connector or clicking on it 2 times, but i need to work this out with some build in function.

So my question is is it possible to set row height automatically to fit all the text then report is being printed?

See the answer at /question/282179/.

The answer at the link doesn’t seem to answer the question of how to set the row height to be automatic based on the contents of the largest cell. The link refers to setting an “optimal height”, which does not solve the issue. Assume no formula is being used and Calc has a table with many rows. One of the rows has multiple lines of text in a particular cell.

1 Like

The lack of automatic row height adjustment has been the single most embarrassing issue in Calc for me in recommending it to my colleagues where I am CEO. It’s also the most frustrating issue I have always had with Calc. To the best of my knowlege and belief, it just plain does not work for a long time now. I am currently on version 7.4.3.2. If there really is a solution to this, I would sure a) like to know what it is and b) like to see it made a default.

I was fighting with this again last night. Here are the symptoms:

A. For normal cells, sometimes rows don’t adjust to wrapped plain text height. To solve, I highlight the entire sheet by clicking on the blank area above row 1 and left of column A. Then I right-click on any row number and choose Optimal Row Height and OK.

B. For vertically (stacked) merged cells (rows merged), nothing I did last night worked.

This solution worked for me:

Posted by: anon73440385 Oct 2020:-

  • Open a new Calc document
  • View -> Styles (or F11)
  • Click icon leftmost (beneath word Styles)
  • Right click on Default (Cell Style) -> Modify - Tab: Alignment
  • Set option [x] Wrap text automatically
  • Click OK
  • File -> Templates -> Save as Template...
  • Provide a Template Name (e.g MyCalCDefault)
  • Select a Template Category (e.g My Templates)
  • Important: Set option [x] Set as default template
  • Click Save
  • Close the document (No further save required)
  • Open a new document an test your settings.

This does not solve the issue for me in version 7.5.5.2. Installing version 24.2.0.3 also does not solve the issue. I believe that EJF001 and anon73440385 did not test enough. Here are the steps to reproduce the issue:

  1. In a new spreadsheet, add text on multiple columns of the same row.

  2. Edit the text on multiple columns to increase their number of lines to various lengths. Row height responsively increases repeatedly.

  3. Edit the text on the longer cells to decrease their number of lines.

  4. Row height does not responsively decrease. You must double-click between the row number and the row+1 number to adjust the row height to fit.

Tom

Go up to the column you want to resize. When the arrow is turned to the left/right symbol, double click. It will auto-size the column to auto-fit the longest string of text in that individual column. I don’t think there is an actual setting to change to the desired effect beyond this way of doing it. If you create another cell that needs more spacing, simply repeat the process and it will auto adjust it again. I hope this helps. The good news is the program saves it as such.

Thank you @Jasonunchained This works for the row height too if you’re on the border between rows and the cursor changes. Double-click and the row height will self adjust to the smallest allowable size based on cell contents.

That is true. But it doesn’t resolve the posted issue of row height adjustment for field values on printing.