Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ReportViewer Question

Status
Not open for further replies.

kgreer

MIS
Jul 18, 2003
155
US
Need some help on using ReportViewer.
I have to reports built. When someone clicks on a button, I want to determine what report to show in the ReportViewer.

How can you do this?

THanks
 
There's a couple ways of accomplishing this:

1) Create a form with the Report Viewer control on it:
Code:
    Dim LstParam As Generic.List(Of Microsoft.Reporting.WinForms.ReportParameter) = Nothing
    If LstParam Is Nothing Then LstParam = New Generic.List(Of Microsoft.Reporting.WinForms.ReportParameter)()
    LstParam.Add(New Microsoft.Reporting.WinForms.ReportParameter("Job_no", JobNumber, False))
    frmSvrReport.Show()

'NOTE: Code has been simplified for this example.

2) Pass the URL to the browser:
Code:
System.Diagnostics.Process.Start("iexplore.exe", _
    "[URL unfurl="true"]http://ServerName/reportserver?"[/URL] & ReportName & "&rs:Command=Render&Job_no=" & JobNumber)

--------------------------------------------------
Stubbornness is a virtue -- if you are right. --Chuck Noll
--------------------------------------------------
 
Sorry for not being clear on this issue, but this is being done in .net C#.

I remember how to do it on the website, but not in C#

Thanks
 
Then you should probably post your question(s) in the C# forum. This is strictly VB.Net.

forum732

--------------------------------------------------
Stubbornness is a virtue -- if you are right. --Chuck Noll
--------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top