Sylvan.Data.Excel icon indicating copy to clipboard operation
Sylvan.Data.Excel copied to clipboard

want to be able to set ExcelDataReader.SheetNames PUBLIC

Open lileyzhao opened this issue 1 year ago • 4 comments

For some usage scenarios, I want to be able to set the access scope for SheetInfo[] sheetNames in ExcelDataReader to public,

Now I can only use the source code to get SheetInfo[]

lileyzhao avatar Aug 31 '22 01:08 lileyzhao

For some usage scenarios

Can you describe the scenario?

MarkPflug avatar Aug 31 '22 14:08 MarkPflug

My English is written through translation, maybe the vocabulary is not particularly accurate.

For example, my users spread their data across multiple sheets, and sometimes no, I want to be able to choose which sheets to import based on the user's discretion, so I want to get the sheet List

lileyzhao avatar Sep 01 '22 07:09 lileyzhao

This is a reasonable request, but I'll have to give it some thought. I don't want to just make the sheet names public, because I feel like for this to be useful, a user would also want to "open" each specific sheet. Currently the "NextResult" is the way to do this, but that only allows moving forward through the sheets. If someone opened a specific sheet, what should happen when NextResult is called? Presumably, it would move to the next sheet.

For now, you can open the sheet twice: the first time through call NextResult and WorksheetName to get the ordered list of worksheets. Then, close and reopen the file and use the sheetnames to provide the user options.

MarkPflug avatar Sep 01 '22 16:09 MarkPflug

You're right, we're more of a financial business, where multiple pieces of data are mixed into one file through different worksheets, so you need to specify a specific sheet for import.

It is possible to open the sheet twice. I can work like this for a while.

lileyzhao avatar Sep 02 '22 05:09 lileyzhao

@MarkPflug Hello, do you have a plan to disclose the ExcelDataReader.SheetNames

lileyzhao avatar Nov 07 '22 05:11 lileyzhao