Posted 20 July 2018, 1:05 am EST
We are using ActiveReports in a web application and we have users in multiple time zones around the world.
How do I set the offset or time zone to use for ReportInfo timestamps when rendering a report?
Forums Home / ActiveReports / ActiveReports v7+
Posted by: joelp on 20 July 2018, 1:05 am EST
Posted 20 July 2018, 1:05 am EST
We are using ActiveReports in a web application and we have users in multiple time zones around the world.
How do I set the offset or time zone to use for ReportInfo timestamps when rendering a report?
Posted 20 July 2018, 2:06 am EST
So after digging around in ILSpy, I came up with this:
// set rundatetime for reportinfo controls
report.ReportStart += (sender, eventArgs) =>
{
var runDateTime = report.GetType().GetProperty("RunDateTime", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
runDateTime.SetValue(report, dateTimeInCorrectZone);
};
I’m surprised there’s not a better way to do this, but at least it works.
Posted 23 July 2018, 2:15 pm EST
Hello,
I am glad that you find the solution yourself. Please feel free to ask If any problem occurs further.
Thanks