Open jzabroski opened 1 month ago
It looks like you support filtering a row, although don't have a specific way to say "first row up to the last populated column". Using your source generator object model, I'd want the range to be the first index and last index written to the excel document.
That's correct, it's not possible right now. You can only pass the cell range reference to AutoFilterOptions
when you create the worksheet. However, I played a bit around with this now, and it seems that Excel might not really care if all the rows are included in the cell range. In Excel the filter seems to include all rows anyway. Have you experienced a different behavior?
I'd similarly want to write a whole collection to the spreadsheet.
In addition to spreadsheet.AddAsRowAsync()
, there is also spreadsheet.AddRangeAsRowsAsync()
that takes an IEnumerable
of your type. Perhaps it's what you're looking for?
Additionally, freeze panes would be a bonus although I honestly rarely use these:
You can freeze rows and columns by setting FrozenRows
and FrozenColumns
on WorksheetOptions
.
In Excel the filter seems to include all rows anyway. Have you experienced a different behavior?
Sort of. One scenario to consider is when you select a range in Excel and click the Auto Filter button in the ribbon. If you don't select a final Subtotal row, it will be smart and won't include that row, although I'm not sure what algorithm it uses to decide this behavior.
I can provide a small test case spreadsheet before and after comparison as a gold copy test if helpful.
Thanks for your patience waiting for my reply!
It looks like you support filtering a row, although don't have a specific way to say "first row up to the last populated column". Using your source generator object model, I'd want the range to be the first index and last index written to the excel document.
I'd similarly want to write a whole collection to the spreadsheet.
Here are some possible interfaces:
Additionally, freeze panes would be a bonus although I honestly rarely use these: