Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The first empty rows aren't displayed #2737

Closed
nghuuphuoc opened this issue Jul 11, 2022 · 2 comments
Closed

The first empty rows aren't displayed #2737

nghuuphuoc opened this issue Jul 11, 2022 · 2 comments

Comments

@nghuuphuoc
Copy link

Sample spreadsheet:
Untitled-spreadsheet.xlsx

Screen Shot 2022-07-11 at 11 16 17

The top first five rows are empty. I would like to see them as well. However, it seems that the library ignores them:

Screen Shot 2022-07-11 at 11 13 38

Is that a bug or default behavior? Is there any option for displaying first empty rows?

@nghuuphuoc
Copy link
Author

cc @hiepsieunhan

@SheetJSDev
Copy link
Contributor

This is a very weird case because the worksheet itself reports the starting cell as A6. You can pin the worksheet to A1 as follows:

/* ws is the worksheet, e.g. workbook.Sheets["Sheet1"] */
var range = XLSX.utils.decode_range(ws["!ref"]);
range.s.r = range.s.c = 0; // force range to start at A1
ws["!ref"] = XLSX.utils.encode_range(range);

We can update the demo with that effect on each worksheet after reading the file.

Changing the library would probably require a version bump since it would break sheet_to_json behavior when the first few rows are blank

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants