Chart date issue?
Chart date issue?
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,
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 (103.83 KiB) Viewed 2852 times
Re: Chart date issue?
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
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 (107.04 KiB) Viewed 2850 times
-
- Posts: 6271
- Joined: Tue Mar 20, 2018 5:34 am
Re: Chart date issue?
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.
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?
Hi there,
This issue is still happening in 2018.2.2
This issue is still happening in 2018.2.2
-
- Posts: 6271
- Joined: Tue Mar 20, 2018 5:34 am
Re: Chart date issue?
Hello,
Please send us your report with test data for analysis.
Thank you.
Please send us your report with test data for analysis.
Thank you.
Re: Chart date issue?
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);
}
}
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 (64.47 KiB) Viewed 2819 times
-
- WebApplication1.zip
- (2.98 MiB) Downloaded 169 times
-
- Posts: 6271
- Joined: Tue Mar 20, 2018 5:34 am
Re: Chart date issue?
Hello,
We got the following result with and without cache helper.
Thank you.
We got the following result with and without cache helper.
Thank you.
- Attachments
-
- Capture.PNG (98.89 KiB) Viewed 2810 times
Re: Chart date issue?
Did you try the project I attached? It gives me the incorrect dates on chat with cache helper.
Re: Chart date issue?
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).
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).
- Attachments
-
- Report.mrt
- (16.42 KiB) Downloaded 198 times
-
- Posts: 6271
- Joined: Tue Mar 20, 2018 5:34 am
Re: Chart date issue?
Hello,
Sorry, maybe we did not exactly understand your problem. Which result do you need?
Thank you.
Sorry, maybe we did not exactly understand your problem. Which result do you need?
Thank you.