I am using EPPlus to create Excel files. I need to get the name of the file containing a worksheet from an ExcelWorksheet or ExcelWorkbook object. I can't find any "name" property in the ExcelWorkbook object, or any way of getting from an ExcelWorkbook or ExcelWorksheet back to the containing ExcelPackage.
Is there a property or path of properties I can use to get from ExcelWorksheet to a file name?
To clarify my intent:
I am creating an API that will create table difference reports. It mainly works with ADO.NET DataTables, but it also has adapters that take interop Worksheets or EPPlus ExcelWorksheets, which it will convert to DataTables for processing.
I only need the file name containing the ExcelWorksheet so that it can be printed on the output report for clarity. The API is only really working at the scope of DataTables or objects that are roughly equivalent to tables, like Worksheets or ExcelWorksheets. It doesn't deal with DataSets, Workbooks, ExcelWorkbooks, or ExcelPackages (except when it outputs a report file using EPPlus).
So, I would very much like the API functions to require a bare minimum of parameters, like DataTables, Worksheets, ExcelWorksheets, and some bitflag options. It would also be nice to have the different overloads of the functions take analogous parameters (i.e. taking two DataTables or two Worksheets, or two ExcelWorksheets), and not require extra clutter parameters for the EPPlus input case.
With interop, it is extremely easy to get a file name from a Worksheet (mySheet.Parent.Name), and EPPlus provides easy ways to move down the object hierarchy (myPackage.Workbook.Worksheets[1]), so I assumed there would be some way to move back up the hierarchy from an ExcelWorksheet object.