Page 1 of 2

Chart date issue?

Posted: Fri Apr 20, 2018 2:47 am
by vineet
Hi there,

I have a chart as per below. The issue is, it fails to understand the proper date formatting and thinks 01-05-2017 is 5th Jan 2017 and so on when it is actually meant to be 1st of May 2017 etc.

The funny thing is, the report culture seems to be fine as the report understands the dates well. Please see the data band I have shown below the chart.

Am I missing some chart settings? All I have set on the X Axis is the format to be MMMM yyyy

Cheers,

Re: Chart date issue?

Posted: Fri Apr 20, 2018 3:45 am
by vineet
Could it be related to this? viewtopic.php?f=13&t=3044
I tried setting StiOptions.Export.Html.ForcedCultureForCharts = new CultureInfo("en-AU"); but it is still showing incorrectly on the WebViewer.
Setting StiOptions.Engine.RenderChartAsBitmap = true works but the chart looks too blurry and unusable.
I am on Stimulsoft Web 2018.2.1

Re: Chart date issue?

Posted: Sun Apr 22, 2018 5:37 pm
by Lech Kulikowski
Hello,

We made some improvements with showing Charts in the WebViewer.

Please check the next release build which will be available in this week.

Thank you.

Re: Chart date issue?

Posted: Mon Apr 30, 2018 11:19 am
by vineet
Hi there,

This issue is still happening in 2018.2.2

Re: Chart date issue?

Posted: Wed May 02, 2018 6:17 am
by Lech Kulikowski
Hello,

Please send us your report with test data for analysis.

Thank you.

Re: Chart date issue?

Posted: Wed May 02, 2018 8:19 am
by vineet
It seems that the problem only happens if I use a custom cache helper class. Charts render fine if I remove the cache helper.

NOTE: Please restore NuGet packages before running the sample project

Here's how I am attaching the helper:
StiWebViewer.CacheHelper = new StimulsoftViewerCacheHelper();

Here's the cacheHelper class code:
public class StimulsoftViewerCacheHelper : StiCacheHelper
{
public override StiReport GetReport(string guid, StiServerCacheMode mode, TimeSpan timeout, CacheItemPriority priority)
{
var path = Path.Combine(HttpContext.Current.Server.MapPath("~/Temp"), "", $"StiViewerCache-{guid}");
if (!File.Exists(path)) return null;
var report = new StiReport();
var packedReport = File.ReadAllText(path);
if (guid.EndsWith("template")) report.LoadPackedReportFromString(packedReport);
else report.LoadPackedDocumentFromString(packedReport);
return report;
}

public override void SaveReport(StiReport report, string guid, StiServerCacheMode mode, TimeSpan timeout, CacheItemPriority priority)
{

var packedReport = guid.EndsWith("template") ? report.SavePackedReportToString() : report.SavePackedDocumentToString();
var path = Path.Combine(HttpContext.Current.Server.MapPath("~/Temp"), "", $"StiViewerCache-{guid}");
File.WriteAllText(path, packedReport);
}

}

Re: Chart date issue?

Posted: Thu May 03, 2018 2:22 pm
by Lech Kulikowski
Hello,

We got the following result with and without cache helper.

Thank you.

Re: Chart date issue?

Posted: Thu May 03, 2018 11:05 pm
by vineet
Did you try the project I attached? It gives me the incorrect dates on chat with cache helper.

Re: Chart date issue?

Posted: Fri May 04, 2018 2:21 am
by vineet
Here's the project on my computer. Maybe it has something to do with how the charts are rendered when they get the system default culture?

Also, I noticed that the chart I attached in the project used the old data set. You can replace that report with this one in the project (~\ReportFiles\ folder).
2018-05-04_121903.jpg
2018-05-04_121903.jpg (93.9 KiB) Viewed 4411 times

Re: Chart date issue?

Posted: Tue May 08, 2018 7:38 am
by Lech Kulikowski
Hello,

Sorry, maybe we did not exactly understand your problem. Which result do you need?

Thank you.