locked
On Browser Back Button +in ReportViewer + missing parameters RRS feed

  • Question

  • User-1604309053 posted

    I am using a ReportViewer control built using VS 2008, which gets populated based on the values selected in 2 dropdowns that needs to be selected before user sees the report.
    Now this is a Drill Through Report and the user can click on one of the rows and go to another report(the drillthrough report). But the problem comes , when the user hits the browser back button , it comes to the page where it was before. It retains the value that existed in the dropdowns.  Now when the user clicks again on the drillthrough link, the ReportViewer_DrillThrough event does not fire and hence I get a message saying invalid credentials or missing parameters. How do I handle this scenario ?

     

    Tuesday, July 5, 2011 7:51 AM

Answers

  • User2105670541 posted

    on page load set the localreport refresh property to true, and bind the dropdowns there

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 5, 2011 12:39 PM
  • User-1604309053 posted

    I used the following script and it worked like a charm. Now whenever the user clicks on the browser back , it displays a prompt message saying page will be reloaded and when user clicks on Yes, it reloads the entire page.

     <input type="hidden" id="refreshed" value="no">
    <script type="text/javascript">
        onload = function() {
            var e = document.getElementById("refreshed");
            if (e.value == "no") e.value = "yes";
            else { e.value = "no"; location.reload(); }
        }
    </script>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 6, 2011 3:20 AM

All replies

  • User-1604309053 posted

    Also I have configured the report in LocalMode and deployed the .rdlc files to the server.

    Tuesday, July 5, 2011 8:23 AM
  • User2105670541 posted

    on page load set the localreport refresh property to true, and bind the dropdowns there

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 5, 2011 12:39 PM
  • User-1604309053 posted

    I used the following script and it worked like a charm. Now whenever the user clicks on the browser back , it displays a prompt message saying page will be reloaded and when user clicks on Yes, it reloads the entire page.

     <input type="hidden" id="refreshed" value="no">
    <script type="text/javascript">
        onload = function() {
            var e = document.getElementById("refreshed");
            if (e.value == "no") e.value = "yes";
            else { e.value = "no"; location.reload(); }
        }
    </script>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 6, 2011 3:20 AM
  • User1471008070 posted

    Great solution, thank you for sharing your experience here. It will be very beneficial for other community members who have similar questions.

    Monday, July 11, 2011 10:45 PM