Skip to content

worksheet.addRow() with wrap text settings on the xlsx file throws the _nextRow and _lastRowNumber off... #783

@vchouhan

Description

@vchouhan

I'm working on a project which requires me to read a .xlsx file which already has some default settings defined and columns names provided. The first 3 rows are formatted with labels and the first writable row starts at line 4 which shows up correctly at the actualRowCount value. I noticed that the worksheet.addRow() was writing to line _nextRow 29 and while the _lastRow count was set to 28. As the first 28 rows starting line 4 had the format cell wrap text enabled.

Steps to re-create the issue with screen grab

  • Create a XLS file and select the first 10 rows and apply the wrap text alignment using the format cells.
  • Read the file using the workbook.xlsx.readFile() and write rows to the worksheet.
  • Log the _nextRow and _lastRowCount and actualRowCount.

  • XLSX file template screen

image

  • Wrap text for each cell enabled till row 16

image

  • Debugging breakpoint with

image

  • file generated with rows starting at line 17

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions