473,387 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Report Viewer Does not Update when passing parameters

CabaasSalwe
I have One Data Set Bends in Reportviewr, My dataset Have two Paramers in Report loud data will Displys in Normaly put the problem is when i pass the paremetrs in new values reportviewer the previouse data in reportviewer does not make any changes .

Here is my Code i use:

Expand|Select|Wrap|Line Numbers
  1. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 
  2.         mysession() 
  3.         Label4.Visible = False 
  4.         Dim field2 As String = CType(Session("agence"), String) 
  5.         Label4.Text = field2 
  6.         Dim Param(0) As ReportParameter 
  7.         Param(0) = New ReportParameter("sessionn", Label4.Text) 
  8.         Me.ReportViewer1.LocalReport.SetParameters(Param) 
  9.         ' 
  10.         If IsPostBack = False Then 
  11.  
  12.             ReportViewer1.ProcessingMode = ProcessingMode.Local 
  13.  
  14.             Dim rep As LocalReport = ReportViewer1.LocalReport 
  15.  
  16.             rep.ReportPath = "Leaving Report.rdlc" 
  17.  
  18.             Dim ds1 As DataSet = GetData() 
  19.  
  20.             'Create a report data source for the sales order data 
  21.  
  22.             Dim EMpReplt As New ReportDataSource() 
  23.  
  24.             EMpReplt.Name = "ProlDataSet_Lrepoert" 
  25.  
  26.             EMpReplt.Value = ds1.Tables("EMPData") 
  27.  
  28.             rep.DataSources.Add(EMpReplt) 
  29.         End If 
  30.  
  31.  
  32.  Private Function GetSalesData() 
  33.  
  34.         Dim ds As New DataSet 
  35.         Dim sql As String = "select * from laeve where Status='" & DropDownList1.SelectedValue & "' and Agent='" & Session("Agence") & "'" 
  36.  
  37.  
  38.             Dim command As New SqlCommand(sql,con) 
  39.  
  40.             Dim mysqlAdapter As New SqlDataAdapter(command) 
  41.  
  42.             mysqlAdapter.Fill(ds, "EMPData") 
  43.  
  44.             mysqlAdapter.Dispose() 
  45.  
  46.             command.Dispose() 
  47.  
  48.         End Using 
  49.  
  50.         Return ds 
  51.  
  52.     End Function 
  53.  
  54.  
  55.  End Sub 
  56.  
  57.     Protected Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click 
  58.  
  59.         ReportViewer1.LocalReport.Refresh() 
  60.  
  61.  
  62.  
  63.  
  64.  
Feb 10 '13 #1
1 2622
Frinavale
9,735 Expert Mod 8TB
I have never used a ReportViewer before, but when you use a GridView and set it's data source you need to call DataBind afterwards.

So, I suggest calling DataBind (or it's equivalent) after setting the data source for your Report Viewer.

-Frinny
Feb 11 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: murl | last post by:
I have created a crystal report using crystal9.0, that is linked to a stored procedure in sql2k which requires 2 parameters to be met, a beggining date(smalldatetime) and a...
0
by: murl | last post by:
I have built a crystal report using crystal9.0 that is linked to a stored procedure built in sql2k, which requires 2 parameters beginningdate(smalldatetime),and endingdate(smalldatetime). When the...
4
by: Mike Dinnis | last post by:
Hi, I've been working through a number of turorials to try to learn more about retrieving data from a SQL database. I think i've mastered techniques where i create a sql string in the page and...
2
by: zdrakec | last post by:
Hello all: I have the Crystal Report viewer imbedded on a .NET form, and it works very well... except, on the target machine, when I set the ReportSource property of the viewer (to a...
0
by: Rick Gamble | last post by:
Recently I've had the opportunity to compare and contrast the report viewer controls performance when accessing an Express MDF and a SQL 2000 DB. Here's what I found and wonder if any of you have...
1
by: jonnyx | last post by:
Hi, I've a simple ASP question. We have a new website which is running on a server using IIS 6.0. When the following address is typed: ...
0
by: John Smith | last post by:
Hello, I am developing a VB.NET 2003 application that will use lots of Crystal Reports. Sometimes the users will preview a report in a Crystal report viewer, and sometimes they will send the...
0
by: jobs | last post by:
Hi. I've got an asp.net website with ssrs reportviewer. The site works great. If I compile the site as follows: aspnet_compiler -f -u -v the reportviewer stops does not work and gives me...
7
by: salzan | last post by:
I have a form in which I collect info from the user and then process various tables. Now, I need to call a report and pass two parameters to it so it’ll only select the desired records for...
0
by: mohanty2050 | last post by:
I am using Crystal Report 9 and VB6.0. I can display the report through Crystal report viewer properly. But the print button in the Crystal report viewer does not work. My printer is in network. If I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.