locked
How to pass client side (User machine) current datetime to report(rdl file) on each view report click RRS feed

  • Question

  • User1467292147 posted

    Hi All,

    I want to show report generation datetime on the report (rdl file). Every time generate report is click time on the current user machine needs to be displayed on the report.

    If i do DateTime.Now then it returns server timing. Need timing of user machine.

    Thanks

    Thursday, December 8, 2011 3:09 AM

All replies

  • User-362017084 posted

    use javascript for this

    <script type="text/javascript">

    var d = new Date();
    document.write(d.getDate());

    </script>

    On the same line set this date to some hidden variable and use it on server side

    Thursday, December 8, 2011 4:26 AM
  • User-1528094326 posted

    It depends if you want to use Ajax or not. If not then create a hidden value and then create a javascript function that will capture the clients time, and store it in that hidden field, then call __doPostBack() using the same javascript and have it read the hidden field during post back and shove it into the report as a parameter.

    If you don't mind using Ajax, then you could simply grab the clients date using the same javascript method, and then send it to the server via ajax and let it load up the report that way.

    Monday, December 12, 2011 7:39 PM