February 3, 2020 at 6:51 pm
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
Try
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
ReportViewer1.ServerReport.Refresh()
Dim Lastname As New ReportParameter()
Lastname.Name = "Lastname"
Lastname.Values.Add("Campbelli")
Dim parameters() As ReportParameter = {Lastname}
ReportViewer1.ServerReport.Refresh()
Catch ex As Exception
Response.Write(ex.ToString())
End Try
End Sub
February 3, 2020 at 8:39 pm
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:
http://www.sqlservercentral.com/articles/61537/
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy