Chart date issue?

Stimulsoft Reports.WEB discussion
vineet
Posts: 69
Joined: Fri Nov 10, 2017 3:12 am

Chart date issue?

Post 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,
Attachments
2018-04-20_124418.jpg
2018-04-20_124418.jpg (103.83 KiB) Viewed 2845 times
vineet
Posts: 69
Joined: Fri Nov 10, 2017 3:12 am

Re: Chart date issue?

Post 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
Attachments
2018-04-20_124418.jpg
2018-04-20_124418.jpg (107.04 KiB) Viewed 2843 times
Lech Kulikowski
Posts: 6238
Joined: Tue Mar 20, 2018 5:34 am

Re: Chart date issue?

Post 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.
vineet
Posts: 69
Joined: Fri Nov 10, 2017 3:12 am

Re: Chart date issue?

Post by vineet »

Hi there,

This issue is still happening in 2018.2.2
Lech Kulikowski
Posts: 6238
Joined: Tue Mar 20, 2018 5:34 am

Re: Chart date issue?

Post by Lech Kulikowski »

Hello,

Please send us your report with test data for analysis.

Thank you.
vineet
Posts: 69
Joined: Fri Nov 10, 2017 3:12 am

Re: Chart date issue?

Post 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);
}

}
Attachments
2018-05-02_180127.jpg
2018-05-02_180127.jpg (64.47 KiB) Viewed 2812 times
WebApplication1.zip
(2.98 MiB) Downloaded 169 times
Lech Kulikowski
Posts: 6238
Joined: Tue Mar 20, 2018 5:34 am

Re: Chart date issue?

Post by Lech Kulikowski »

Hello,

We got the following result with and without cache helper.

Thank you.
Attachments
Capture.PNG
Capture.PNG (98.89 KiB) Viewed 2803 times
vineet
Posts: 69
Joined: Fri Nov 10, 2017 3:12 am

Re: Chart date issue?

Post by vineet »

Did you try the project I attached? It gives me the incorrect dates on chat with cache helper.
vineet
Posts: 69
Joined: Fri Nov 10, 2017 3:12 am

Re: Chart date issue?

Post 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 2799 times
Attachments
Report.mrt
(16.42 KiB) Downloaded 198 times
Lech Kulikowski
Posts: 6238
Joined: Tue Mar 20, 2018 5:34 am

Re: Chart date issue?

Post by Lech Kulikowski »

Hello,

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

Thank you.
Post Reply