Excel Export Error
Excel Export Error
WarrenCoy
Posts: 5Questions: 0Answers: 0
Error messages shown: Excel shows Alert dialog: We found a problem with some content...
Description of problem: For the first row only it gives the error and shows NaN instead of the part number in excel
Replies
Example HTML of the table:
Many thanks! Our Excel formatter is treating that as an ISO8601 date! The result is that the
51
goes intoDate.parse
as the month which of course it rejects outright.I've tightened up the regex (commit) to address this - thanks for letting me know about it!
The nightly will rebuild with the change shortly.
Allan
Is there anyway to flag a cell as a specific type so auto formatting doesn't happen? Would make the result more readable. If a part is just a number it may drop the leading zero (perhaps)?
With a parts database multiple parts could look like a date but they are not dates or numbers but really strings.
No sorry. The Excel formatting stuff isn't even exposed publicly, so it can be removed unfortunately. I can add that though (there is even a comment in the code to that effect), or you could modify your copy of the Buttons file to strip this line.
Allan
Thank you Allan, I will check it out. I use various PHP libraries to do this excel export and the only tweak I had to make was forcing a column to be text and not auto format as a number (granted I have not done a ton of exports) and that was really the only tweak as dates and other formats work great generally.
If I assume YYYY-MM-DD I found a more exact regex at
https://regexland.com/regex-dates/
Which checks for 01-12 for months and 01-31 for days (granted not all months have 31 days). So for this specific issue it works great in avoiding the invalid date (part number).
Thank you for your help.