How do I VB.NET pass stored procedure parameters to a report viewer object

I am trying to add myParameterID as a parameter for Me.ReportViewer1.


If I run this code i will see my report load into a web page.


      Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

            Dim v_report_name As String = "reportName"
            Dim v_report_server As String = "http://serverName/ReportServer"
            Dim v_report_path As String = "/FolderName/"

                Dim myParameterID As String = "ML2zsidjf99"

            Me.ReportViewer1.ServerReport.ReportServerUrl = New System.Uri(v_report_server)
            Me.ReportViewer1.ServerReport.ReportPath = v_report_path + v_report_name

      End Sub
Michael HoodDeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
Does this answer your question?

Lesson 1: Adding Parameters to Filter Reports by Date (SSRS)
http://technet.microsoft.com/en-us/library/aa337401(v=sql.105).aspx
0
Michael HoodDeveloperAuthor Commented:
No sir,
That link is more for the ssrs sql side of town.

I am working with the code behind for a vb.net page.  I need vb.net code to pass the parameter to a report viewer web object.
0
FamousMortimerCommented:
Hi,

You need to add a reference to Microsoft.Reporting.WinForms.

The code below should get you started.

            Dim myReportParams(1) As ReportParameter
            myReportParams(0) = New ReportParameter("myParameterID", "ML2zsidjf99")
            myReportParams(1) = New ReportParameter("anotherParam", "YourValueHere")
            Me.ReportViewer1.ServerReport.SetParameters(myReportParams)

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Michael HoodDeveloperAuthor Commented:
thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.