umya-spreadsheet icon indicating copy to clipboard operation
umya-spreadsheet copied to clipboard

`Row.set_height` method not work?

Open PleaseDont opened this issue 4 months ago • 5 comments

Here my simple code:

    let mut book = new_file_empty_worksheet();
    let sheet = book.new_sheet("sheet1").unwrap();

    sheet
        .get_cell_mut((1, 1))
        .set_value_string("Merry Christmas!")
        .get_style_mut()
        .get_font_mut()
        .set_bold(true)
        .set_name("Arial")
        .set_size(18.0);
    sheet
        .add_merge_cells("A1:F1")
        .get_row_dimension_mut(&1)
        .set_height(24.0);

    writer::xlsx::write(&book, "greet.xlsx").unwrap();

then I got:

Image

seems that set_height not work, or did I miss something else?

PleaseDont avatar Sep 23 '25 11:09 PleaseDont

@PleaseDont Thank you for your message. I tried the code you provided, and the height became 20. It appears to be working fine. (I used umya-spreadsheet version 2.3.3.)

If the issue persists, please send us the Excel file. We will analyze it.

MathNya avatar Sep 25 '25 07:09 MathNya

@MathNya Thank you for replying.

I test again on my Windows 11 PC, and got this:

Image

On macOS 26 Macbook M1 is:

Image

Then I unzip the file, and I found

Image

So, sorry about my mistake, it works well.

The stored values in the document may display differently across different computer systems, and I need to figure out why this happens, thank you.

PleaseDont avatar Sep 26 '25 14:09 PleaseDont

@MathNya Check xlsx_demo please.

PleaseDont avatar Sep 27 '25 04:09 PleaseDont

@PleaseDont I checked the Excel file at the specified URL, but the row height still appears as 24 in my environment. Functionality was verified on Windows 11 using Excel, ONLYOFFICE, and WPS Office.

I also checked the contents of the unzipped XML file but found no entries that seemed likely to cause the issue.

MathNya avatar Sep 29 '25 02:09 MathNya

@MathNya That's so weird. I install ONLYOFFICE and everything seems just fine. My Excel broken? But I still wonder why rust_xlsxwriter works properly for my computer. Never mind, maybe I'll figure out exactly what went wrong later. Thank you.

PleaseDont avatar Sep 30 '25 07:09 PleaseDont