?
Solved

ReportViewer Refresh?

Posted on 2012-03-27
5
Medium Priority
?
1,551 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

800 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