Reporting Services and VWD Parameters

  • Hi All

    In my application i am using Visual Web Developer 2008 and SQL Server with Reporting Services 2005 on an XP Pro machine. Using the ReportViewer Control in VWD I can view reports deployed on my report server. Now I have added parameters to my report which I wish to set in VWD. I have got alot of code from the net and they all look similar. Below is the code I am using...

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

    Me.ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote

    Me.ReportViewer1.ServerReport.ReportServerUrl = New Uri("http:\\localhost\ReportServer")

    Me.ReportViewer1.ServerReport.ReportPath = "/Report Project1/Report1"

    ReportParameter[] parm = new ReportParameter[1];

    parm[0] = new ReportParameter("ID", 0, false);

    ReportViewer1.ServerReport.SetParameters(parm);

    Me.ReportViewer1.ServerReport.Refresh();

    End Sub

    I get the following Error:

    Name 'ReportParameter' is not declared

    Am I missing some sort of dll or should I have declared this somewhere?

    Any help will be appreciated.

    Thanks in Advance....

  • Sorry Guys, I just saw a solution for my problem on another website.

    i should have done it as follows:

    Me.ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote

    Me.ReportViewer1.ServerReport.ReportServerUrl = New Uri("http://localhost/reportserver")

    Me.ReportViewer1.ServerReport.ReportPath = "/Report Project1/Report1"

    Dim params(0 To 0) As Microsoft.Reporting.WebForms.ReportParameter

    Dim p As Microsoft.Reporting.WebForms.ReportParameter

    p = New Microsoft.Reporting.WebForms.ReportParameter("ID", 2)

    params(0) = p

    ReportViewer1.ServerReport.SetParameters(params)

    ReportViewer1.ServerReport.Refresh(

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply