Row height not working in write_only mode

Issue #629 resolved
Chun-Chia Chen
created an issue

In write_only mode, ws.row_dimensions[i].height is not work.

To reproduce:

ROW_HEIGHT = 48


def _fill_content(ws):
    for i in range(1, 4):
        row = []
        for col in ['AA', 'BB', 'CC']:
            cell = WriteOnlyCell(ws, value='%s' % col)
            row.append(cell)
        ws.append(row)
        ws.row_dimensions[i].height = ROW_HEIGHT


if __name__ == '__main__':
    # normal
    wb1 = Workbook()
    ws1 = wb1.active
    _fill_content(ws1)
    wb1.save('1_normal.xlsx')

    # write-only
    wb2 = Workbook(write_only=True)
    ws2 = wb2.create_sheet()
    _fill_content(ws2)
    wb2.save('2_write_only.xlsx')

Comments (5)

  1. CharlieC

    What you want can't work anyway because it would involve setting the height on a row after it's been written out to XML so you'd have to set all the dimensions before you start adding rows.

  2. Log in to comment