-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
How to access Row Object and set properties #81
Comments
@neversaid Row properties are not parsed or written at the moment. It is on the roadmap :) If you are interested in adding it now, the process is fairly straightforward. The line that writes the row tag on output is: https://github.com/SheetJS/js-xlsx/blob/master/bits/67_wsxml.js#L244
To make rows hidden, add
I would stick the metadata in an array
To set row
Then the write_ws_xml_data function would check at the end of each row:
|
@SheetJSDev TIA |
Contributions are welcome :) If you want to send a contribution, can you also add similar logic to the parser? The code is in the same file, and there are two additions to the code: https://github.com/SheetJS/js-xlsx/blob/master/bits/67_wsxml.js#L152 Just before the for-loop, add an empty array to the worksheet:
Later in the code, https://github.com/SheetJS/js-xlsx/blob/master/bits/67_wsxml.js#L158
Right after that, save the tag in the array:
We'd also need some tests. For now, keep it simple: generate a file, read it, and check if the hidden property is preserved. As an example roundtrip test, https://github.com/SheetJS/js-xlsx/blob/master/test.js#L400 writes the workbook in memory as a nodejs Buffer and then reads it. |
based on comment from @SheetJSDev: SheetJS/sheetjs#81 (comment) fixes #81 h/t @neversaid
based on comment from @SheetJSDev: SheetJS#81 (comment) fixes protobi#81 h/t @neversaid
based on comment from @SheetJSDev: SheetJS/sheetjs#81 (comment) fixes #81 h/t @neversaid
Hi All,
thanks for creating such a great project.
I tried to figure out how its possible to set some Row Properties when creating a XLSX Spreadsheet - i need to set the property "hidden" on the Row to hide it.
How is the best practice to do this?
Thanks a lot,
Bernhard
The text was updated successfully, but these errors were encountered: