Read specific set of rows #475

Open
opened 7 years ago by ashwinpoosarla · 4 comments
ashwinpoosarla commented 7 years ago (Migrated from github.com)

I have used 'sheetRows' properties to read 'n' rows of a sheet but is it possible to read 'n' rows from 'k'the row.
Eg. I want to read 100 rows starting from 500th row. Can this be possible?

I have used 'sheetRows' properties to read 'n' rows of a sheet but is it possible to read 'n' rows from 'k'the row. Eg. I want to read 100 rows starting from 500th row. Can this be possible?
reviewher commented 6 years ago (Migrated from github.com)

@ashwinpoosarla It's not hard but you have to decide on the expectations.

For example:

  1. do you write the sheet range as if the file started from A1? Or do you keep the original range from the worksheet?

  2. what do you do with merge cells that start before the block but end in the block? Do you rewrite the merge range?

Note: You still have to scan from the beginning to cover cases like merge cells:
screen shot 2017-03-25 at 02 49 46

@ashwinpoosarla It's not hard but you have to decide on the expectations. For example: 1) do you write the sheet range as if the file started from A1? Or do you keep the original range from the worksheet? 2) what do you do with merge cells that start before the block but end in the block? Do you rewrite the merge range? Note: You still have to scan from the beginning to cover cases like merge cells: <img width="480" alt="screen shot 2017-03-25 at 02 49 46" src="https://cloud.githubusercontent.com/assets/24845478/24320150/f630cfa0-1105-11e7-8a6e-674cefaa5b4a.png">
BhaveshpatelGenisys commented 1 year ago (Migrated from github.com)

Any positive updates in this? Do we have sheetRowsOffset available?

Any positive updates in this? Do we have sheetRowsOffset available?
SheetJSDev commented 10 months ago (Migrated from github.com)

There are a few concerns with sheetRowsOffset. In addition to what was mentioned in https://github.com/SheetJS/sheetjs/issues/475#issuecomment-289193604 ,

  1. Should a number of header rows be included with each page? If yes, how many (and should it be programmable)? If no, how would non-AoA processing work? (array of arrays "just work" but array of objects require some feedback on the header labels)

  2. (this technically applies in the no-offset case as well) what does the export look like? For example, if the parser reads rows 501 to 1000, what should the writers generate? Supposing you shift the rows up (so that row 501 -> 1, 502 -> 2, ..., 1000 -> 500), the defined names and other metadata are now incorrect. Another option is to forcefully hide rows 1:500, which clearly modifies the row metadata. Leaving 500 rows blank is also an option, but it does not play nice with some of the API functions that expect data on the first row.

There are a few concerns with `sheetRowsOffset`. In addition to what was mentioned in https://github.com/SheetJS/sheetjs/issues/475#issuecomment-289193604 , 1) Should a number of header rows be included with each page? If yes, how many (and should it be programmable)? If no, how would non-AoA processing work? (array of arrays "just work" but array of objects require some feedback on the header labels) 2) (this technically applies in the no-offset case as well) what does the export look like? For example, if the parser reads rows 501 to 1000, what should the writers generate? Supposing you shift the rows up (so that row 501 -> 1, 502 -> 2, ..., 1000 -> 500), the defined names and other metadata are now incorrect. Another option is to forcefully hide rows 1:500, which clearly modifies the row metadata. Leaving 500 rows blank is also an option, but it does not play nice with some of the API functions that expect data on the first row.
hemantvetal813 commented 10 months ago (Migrated from github.com)

There are a few concerns with sheetRowsOffset. In addition to what was mentioned in #475 (comment) ,

  1. Should a number of header rows be included with each page? If yes, how many (and should it be programmable)? If no, how would non-AoA processing work? (array of arrays "just work" but array of objects require some feedback on the header labels)
  2. (this technically applies in the no-offset case as well) what does the export look like? For example, if the parser reads rows 501 to 1000, what should the writers generate? Supposing you shift the rows up (so that row 501 -> 1, 502 -> 2, ..., 1000 -> 500), the defined names and other metadata are now incorrect. Another option is to forcefully hide rows 1:500, which clearly modifies the row metadata. Leaving 500 rows blank is also an option, but it does not play nice with some of the API functions that expect data on the first row.
  1. For array of objects, 1st row can be considered as header.
  2. If user wants 500 to 1000 data then this is fine
    row 501 -> 2, 502 -> 3, ..., 1000 -> 501, with headers. If both metadata would be present in output would be great
> There are a few concerns with `sheetRowsOffset`. In addition to what was mentioned in [#475 (comment)](https://github.com/SheetJS/sheetjs/issues/475#issuecomment-289193604) , > > 1. Should a number of header rows be included with each page? If yes, how many (and should it be programmable)? If no, how would non-AoA processing work? (array of arrays "just work" but array of objects require some feedback on the header labels) > 2. (this technically applies in the no-offset case as well) what does the export look like? For example, if the parser reads rows 501 to 1000, what should the writers generate? Supposing you shift the rows up (so that row 501 -> 1, 502 -> 2, ..., 1000 -> 500), the defined names and other metadata are now incorrect. Another option is to forcefully hide rows 1:500, which clearly modifies the row metadata. Leaving 500 rows blank is also an option, but it does not play nice with some of the API functions that expect data on the first row. 1. For array of objects, 1st row can be considered as header. 2. If user wants 500 to 1000 data then this is fine row 501 -> 2, 502 -> 3, ..., 1000 -> 501, with headers. If both metadata would be present in output would be great
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#475
Loading…
There is no content yet.