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.
Unfortunately, activation email could not send to your email. Please try again.

Chart issue with date string in FileFormats

Thread ID:

Created:

Updated:

Platform:

Replies:

131968 Aug 5,2017 07:10 PM Aug 8,2017 09:29 AM ASP.NET Core 5
loading
Tags: DocIO
Pieter van Kampen
Asked On August 5, 2017 07:10 PM

Hi,
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?

Pieter
                    


Attachment: Rapport_Hoe_CERQ_(3)_9da7c9f9.zip

Pieter van Kampen
Replied On August 6, 2017 05:23 AM

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?


Ramanan  Hariharasubramanian [Syncfusion]
Replied On August 7, 2017 10:22 AM

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:
http://www.syncfusion.com/downloads/support/forum/131968/ze/GenerateWord-1163095579  

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.

Regards,
Ramanan H.


Pieter van Kampen
Replied On August 7, 2017 03:21 PM

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


Pieter van Kampen
Replied On August 7, 2017 03:46 PM

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

Mohanaselvam  Jothi [Syncfusion]
Replied On August 8, 2017 09:29 AM

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,

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Please let us know if you have any concern.

Regards,
Mohanaselvam J.
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;