Calling SSRS report from ASP.Net

  • ijaz32

    SSC Enthusiast

    Points: 114

    I have a web page in Web Forms with a Script Manager, a Button and a Reportviewer.

    I want to click the button and run my report. The report is not populating. My code is as follows:

     Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

    ReportViewer1.ProcessingMode = ProcessingMode.Local

    Dim myreportviewer As ServerReport
    myreportviewer = ReportViewer1.ServerReport

    ReportViewer1.ServerReport.ReportServerUrl = New Uri("https://localhost/ReportServer")
    ReportViewer1.ServerReport.ReportPath = "C:/Practice/Practice/Practice/Report2.rdl"
    ReportViewer1.Height = 900
    ReportViewer1.Width = 900

    Dim Lastname As New ReportParameter()

    Lastname.Name = "Lastname"

    Dim parameters() As ReportParameter = {Lastname}


    Catch ex As Exception


    End Try

    End Sub
  • Michael L John

    One Orange Chip

    Points: 25946

    This is incorrect:

    ReportViewer1.ServerReport.ReportPath = "C:/Practice/Practice/Practice/Report2.rdl"

    It needs to be the https://localhost/ReportServer/FolderName/ReportName

    Michael L John
    If you assassinate a DBA, would you pull a trigger?
    To properly post on a forum:

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

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