-
Notifications
You must be signed in to change notification settings - Fork 284
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
ExcelAddressUtil.NameInvalidChars missing "\"" #1110
Comments
Hi there! I tried the following in epplus 6.2.10
And was unable to reproduce the issue as it functioned as expected. Perhaps I assumed the way you're calling LoadFromDatatable wrong? Could you provide a reproducible sample so we can see what's different? Are you perhaps trying to import the whole table including headers into an excelTable? Quote (") is not allowed for the names of tables in excel. An alternate name in the same configuration could be one potential solution for that sure. Also thanks for offering the PR! But we prefer to resolve things internally. |
Yeah, you're almost right - the problem only occurs if i set a Table style:
And ensuring a correct name via (By the way: your Why is the table name even relevant? It is not used for the output, is it? Since I may not change my object names, I edit a copy of them right now ( |
The problem appears when you set a tableStyle because when you do Epplus creates an ExcelTable in the worksheet. This as the intended behaviour is if you supply a tableStyle you want a table with that style to appear in Excel. And a table must have a name and as such uses the datatable's name and therefore is relevant for the output. However throwing because of it is unintended behaviour. We've created a fix now that will generate a new basic table name (in this example Table1) if the dataTable name is invalid. It'll be in our next release most likely next week.
as for ExcelAddressUtil.SheetNameInvalidChars the |
At least the German Excel version doesn't block you from typing a |
Just checked it even more: Edit: and now I saw you're already checking this with an exception. Everything's fine :) |
EPPlus usage
Personal use
Environment
Windows
Epplus version
6.2.10
Spreadsheet application
Excel
Description
When using the
LoadFromDataTable
method on a dataTable that has a Quote (") in it's name, the method fails.By the way, one more question: since I do not want to change my DataTable's name, how about passing an alternate name with the configuration (beside bool PrintHeaders, TableStyles? TableStyle)? So the DT's name doesn't need to change? I'd offer a PR, if requested :)
The text was updated successfully, but these errors were encountered: