If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > passing parameter to reportViewer control

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-20-10, 17:14
kpeeroo kpeeroo is offline
Registered User
 
Join Date: Jul 2009
Posts: 143
passing parameter to reportViewer control

Hi,

I am using report viewer on an asp.net page. i am trying to pass a parameter to my report but it does not seem to work. I have dragged and dropped reportViewer control on the page and created a new report. My report contains a simple table and I just dragged and dropped a field from my dataset like 'first name' in it.
Can anybody give advise please?
I have used this code but I do not think its working: In there I want to pass john to my sql query so that it retrieves a resultset about 'john' which is the parameter in this case.

Code:
Dim sd As mancosaDataSetTableAdapters.StudentTableAdapter = New mancosaDataSetTableAdapters.StudentTableAdapter
        Dim ds As mancosaDataSet.StudentDataTable = New mancosaDataSet.StudentDataTable

       sd.Fill(ds, "john")
        Dim datasource As New ReportDataSource("hey", ds)

       ReportViewer1.LocalReport.DataSources.Clear()
        ReportViewer1.LocalReport.DataSources.Add(datasource)
        ReportViewer1.LocalReport.Refresh()
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On