Skip to content
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

Read table by name only #60

Open
mjkallen opened this issue Aug 23, 2016 · 2 comments
Open

Read table by name only #60

mjkallen opened this issue Aug 23, 2016 · 2 comments

Comments

@mjkallen
Copy link

The readTable() function in the package requires the sheet index or name to be provided, but table names must be unique in an Excel workbook and thus the XSSFWorkbook Java class in the POI library has a getTable(java.lang.String) method which returns an object of class XSSFTable.

I'm tempted to submit a pull request which adds this feature, but unfortunately the generic function readTable requires a value for the sheet argument to be provided. Making this argument optional would introduce backward incompatibilities, especially since it would be more natural to switch the order of the sheet and table arguments. One solution could be to assume that negative values for sheet indicate that tables should be looked up by their name only.

Any thoughts on this suggestion?

@martinstuder
Copy link
Member

Hi @mjkallen,

thanks for getting in touch! I'm open to introduce a backwards-incompatibility for the sake of a cleaner and simpler API. I would be happy to review an appropriate pull request. Before releasing, I would get in touch with the maintainers of packages depending on XLConnect to make sure they have enough time to adapt accordingly.

Let me know what you think.

Thanks & Best regards,
Martin

@mjkallen
Copy link
Author

Hi Martin,

it turns out that my client doesn't like using tables anyway, because they slow things down too much. So for now there is no pressing need to implement this. One other approach you could use is to add a function which returns the name (or index) of the worksheet which contains the named region (or table). I believe that the POI library has a method for that. You could then use this if the sheet argument is not provided.

Regards,

Maarten-Jan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants