On re-reading, let me summarize. When I attach a "-" (or any other characters) to the formatted date string, all goes well.
When I remove the "-", so use just the formatted date string, I get a corrupted document.
Off course I don't want the "-" in front of my dates. What should I do?
Hi Ramanan,
Thanks for that!
I am using asp.net core rather than MVC, and ported your sample in to it. It works okay as in your sample, but it shows the behavior when I change the dates to this:
data[1][0] = "22-5-2017";
data[2][0] = "6-2-2017";
data[3][0] = "30-7-2017";
These are standard dates in Netherlands locale.
I can send you my sample, but I assume if you change the dates in your sample it shows the same.
Pieter
Some more info found: it depends on the date format of your PC (after restarting the web application in VS.
a) As long as the dates are in line with the date format on the system the document is generated
b) with Dutch-Netherlands dates and English US date format and with Us dates with Dutch-Netherlands date format, the document can't be opened.
c) when the document works the dates are changed to a date in year 2134.
I also changed the input dates to DateTime variables, but this generates the same futuristic output.
Attached my asp.net core sample