We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Chart issue with date string in FileFormats

Please check this issue with dates. I am creating a group of charts, with categories based on dates. I only want to show the date string, not have a time line. 

The statement using string SessionDate1() 
chart.ChartData.SetValue(col, 1, "-" + SessionDate1(tblSessionRetest[col - 1]));
puts the dates in the ChartData (in a loop for each date, and another loop for each chart). 

and then I put the strings in the categories:
chart.PrimaryCategoryAxis.CategoryLabels = chart.ChartData[1, 1, scoreRetestResults.Count + 1, 1];

As you can see I have put a "-" before the date, to force it to a string interpretation. This gives the correct date on the category axis.

However, when I remove the "-", the document is corrupt, it won't open in Word. Before I had a number displayed in stead of a date, but now I don't even have that.

Is this a bug, or am I doing something wrong?


Attachment: Rapport_Hoe_CERQ_(3)_9da7c9f9.zip

5 Replies

PV Pieter van Kampen August 6, 2017 09:23 AM UTC

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?

RH Ramanan  Hariharasubramanian Syncfusion Team August 7, 2017 02:22 PM UTC

Hi Pieter,

Thank you for contacting Syncfusion support.

We are unable to reproduce the reported issue from your side.
We have prepared a sample based on your requirement which can downloaded from the following link.

Sample link:

Kindly modify the sample to reproduce the issue and share us the issue reproducing sample along with chart data which will be helpful to provide you a prompt solution at the earliest.

Please let us know if you have any concerns.

Ramanan H.

PV Pieter van Kampen August 7, 2017 07:21 PM UTC

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.


PV Pieter van Kampen August 7, 2017 07:46 PM UTC

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

Attachment: Generate_DocDates_7937bef1.zip

MJ Mohanaselvam Jothi Syncfusion Team August 8, 2017 01:29 PM UTC

Hi Pieter,

Thank you for using Syncfusion products.

A support incident to track the status of your query has been created under your account. Please log on to our support website to check for further updates,


Please let us know if you have any concern.

Mohanaselvam J.

Live Chat Icon For mobile
Up arrow icon