none
ReportViewer does not refresh when called from method that is called from dropdown control RRS feed

  • Question

  • Hi,

    I have a dropdown with report paths that will call a method to populate and refresh the report viewer. 
    When I debug the code gets passed fine and even goes to the referesh() but nothing happens.

    I don't think the method that I've done is overly complicated and it is very similar to what others have done in posts that I have read.
    Any advice or suggestions are greatly appreciated.

    Thanks!

     

            private void ShowReportViewer(reportPath)
            {

                //Reset the report viewer

                rptViewer.Reset()      
               
                //Set the Report Server URL
                rptViewer.ServerReport.ReportServerUrl = new Uri(ConfigurationManager.AppSettings[ReportServiceConstants.ReportServerURL]);

                //Set the processing mode to remote b/c connecting to remote server
                rptViewer.ProcessingMode = ProcessingMode.Remote;

                //No need to add the RDL extension on the report
                //rptViewer.ServerReport.ReportPath = "/RP1/Report2";
                rptViewer.ServerReport.ReportPath = reportPath;

                rptViewer.ShowParameterPrompts = Convert.ToBoolean(ConfigurationManager.AppSettings[ReportViewConstants.ShowParameterPrompt]);

                //Refresh the report viewer control
                try
                {
                    rptViewer.RefreshReport();
                    rptViewer.Refresh();
            
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }

    Thursday, April 21, 2011 6:42 PM

All replies

  • So I see what i'm doing wrong here.

    My dropdown is in DropdownControl.xaml user control and the reportviewer is in ReportViewer.xaml user control.

     

    The problem here is i'm trying to call the method to refresh from DropdownControl.xaml.

    What i did was probably wrong. I instantiate a ReportViewer.xaml object and then call the method.  I think this is the problem. It has been a long day...not thinking properly how to get this done properly.

    Any suggestion are greatly appreciated.  Thanks!

    Thursday, April 21, 2011 8:00 PM