Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

ReportViewer Refresh?

Posted on 2012-03-27
5
Medium Priority
?
1,565 Views
Last Modified: 2012-04-07
I've got a ReportViewer control setup in a MultiView which has 2 Views.  The first View has questions for the user with dropdowns.  The second View contains the ReportViewer.  My goal is to setup the ReportViewer to display report data based on what the user selects in the dropdowns.

When I hard-code the query values into the ReportViewer and set the MultiView to load the 2nd View, it works fine.  When I set the MultiView to load View 1, however, by the time I get to the second View, the ReportViewer is not visible.

My best guess is that I need to fire a Reload method, or something like that, for the ReportViewer.  I researched this, however, and none of the items I tried seemed to work (e.g. .Refresh(), .Render() etc.)

Environment: C#.NET 4.0, Webforms
0
Comment
Question by:adskarcox
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 

Author Comment

by:adskarcox
ID: 37788579
--
0
 
LVL 12

Expert Comment

by:CmdoProg2
ID: 37788898
The refresh method of the reportviewer does load the report.  Did you load the parameters prior to the refresh?  Here is a snippet of a remote server reportviewer in a multiview...

  Protected Sub btnFind_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnFind.Click
          MultiView1.ActiveViewIndex = 1
          BuildReport()
  End Sub

  Private Sub BuildReport()
    'Get Report Server
    Dim urlReportServer As Uri = clsCommon.GetReportServer()

    With rvContributor
      .ServerReport.ReportServerUrl = urlReportServer
      .ServerReport.SetParameters(BuildParameters())
      .ServerReport.Refresh()
      .ShowPromptAreaButton = False
    End With

  End Sub
  Private Function BuildParameters() As System.Collections.Generic.List(Of ReportParameter)
    Dim paramList As New Generic.List(Of ReportParameter)
    paramList.Add(New ReportParameter("CountyID", ddlCounty.SelectedValue))
    paramList.Add(New ReportParameter("CountyInNotes", chkLookInNotes.Checked))
    Return paramList
  End Function

Open in new window

0
 

Author Comment

by:adskarcox
ID: 37796360
CmdoProg2 - thank you for your post, but I am using C# (not visual basic).
0
 

Accepted Solution

by:
adskarcox earned 0 total points
ID: 37796362
I ended up removing the MultiView.
0
 

Author Closing Comment

by:adskarcox
ID: 37818652
No acceptable solutions were provided.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question