Passing Parameters from ASP.NET page
Hi there,
I have asp.net page with Multi select listbox (Northwind customers table)
I created report on the server called Customers (patamerer = In(@Company))
When user pick few customers name and click submit the page store the values on label
And then pass into the report with the following code
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
'Get Customers from Listbox multi select
Dim i As Integer
Dim s As String = Trim(Label1.Text)
Label1.Text = " "
For i = 0 To ListBox1.Items.Count - 1
If ListBox1.Items(i).Selected Then
Label1.Text = Label1.Text & ListBox1.Items(i).Text & vbCrLf
End If
Next
'Pass multi value into the report
Dim colRP As New System.Collections.Generic.List(Of Microsoft.Reporting.WebForms.ReportParameter)
colRP.Add(New Microsoft.Reporting.WebForms.ReportParameter("Company", UCase(Label1.Text.TrimStart)))
ReportViewer1.ServerReport.ReportServerUrl = New Uri("http://localhost/ReportServer")
ReportViewer1.ServerReport.ReportPath = "/Northwind/Customers"
ReportViewer1.ServerReport.SetParameters(colRP)
ReportViewer1.ServerReport.Refresh()
End Sub
Now everything works fine when the ShowParameterPrompts is = True
Then you need to click View Report button
But when the ShowParameterPromts is = False
The report is not render (the parameters value are there)
My goal is to not show the Parameter on the report instead
Pass the parameter directly from asp.net
How do I make the report render? after the parameters passed
Thanks
Oded Dror
December 26th, 2010 7:08am
Oded shalom
We call reports in that way, see if that helps you
Dim RetVal As Long
RetVal = Shell("c:\progra~1\Intern~1\iexplore.exe
http://localhost/ReportServer/Pages/ReportViewer.aspx?%2fFolderReports%2frptReportName&rs%3aCommand=Render&ParamName=" & param_variable, vbMaximizedFocus)
Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
Free Windows Admin Tool Kit Click here and download it now
December 26th, 2010 7:30am