-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Call GetSheetName can not get correct sheetname #485
Comments
Hi @virteman, thanks for your feedback. Could you provide testing file attachment? |
This is likely related to the changes I made here since the old method of using SheetID was causing the bug in #457 It looks like we need to update GetSheetIndex to actually return the index rather than the SheetID since SheetID isn't a reliable index. |
Dear developers, Do you have any updates on the issue? I have just moved to your package from another xlsx parser and when started testing on real data, it turned out it doesn't work for a lot of files. For instance, I have a file with the only one sheet. I would like to get that sheet and I use Could you please clarify that and/or give us some ETA on the fix? I used the latest version v2.1.0. You can get the file here (I filled it up with the fake data). We would be grateful you could look into that. PS. Do you also know why I don't see the commit mentioned above in a released version? |
Hi @mariaefi29, thanks for your feedback, the ID returned by |
Thank you for your reply! Very confusing :) Could you please advice us what to do? How can we get the only one sheet in excel file if we don't know the name of the sheet? So do I understand right that index is not index in its way, but just an ID of the sheet and it can be sort of random? |
Right now it's inconsistent, per my comment above. I had implemented a partial fix in #457 via #463 which was moving everything to be index based but missed a couple parts of the API. It's been a while since I looked at this but I think Xuri decided to roll back my change in #486 and make everything work off the SheetID instead. |
Yes, as you said, ID is just the identifier of the worksheet inside the spreadsheet, it doesn't start with 1. |
Dear developers, Thank you for your replies! @xuri Do you have any ETA on |
The |
Thank you for this information! |
Would you like to consider change naming for major release version later? Index implies that there be some kind of an order. Sheet's index seems like really a sheet's number, not an identifier, even though it can be an identifier. But id may not be index. |
Yes, currently, the "Index" of the API is actually an "ID", the next version will use a real index instead of an ID. The following functions will be affected:
|
Cool! Thanks! |
Hi @mariaefi29, I have added a new function |
Dear @xuri, Thank you very much! I have tested it on the files from my flow and everything has worked as expected! |
- added 3 internal function: getSheetID, getActiveSheetID, getSheetNameByID
Description
GetSheetName can not get correct sheet name just return empty string
Steps to reproduce the issue:
Describe the results you received:
I get an empty string as sheetname
Describe the results you expected:
I expect the return string should be "basic"
Output of
go version
:Excelize version or commit ID:
Environment details (OS, Microsoft Excel™ version, physical, etc.):
The text was updated successfully, but these errors were encountered: