Set Timezone for ReportInfo control

Posted by: joelp on 20 July 2018, 1:05 am EST

    • Post Options:
    • Link

    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

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels