Monday, December 03, 2007 8:19 PM
Is it possible to send a parameter to the report viewer inorder to display a particular customer details. I want to send customer-id to report viewer to see the details of particular customer.
How can i achieve this?
Hoping for reply.
Thursday, December 06, 2007 5:50 AM
According to your question on passing parameter to Report Viewer, I would like to provide you the suggestions as follows:
1. Please consider to use Microsoft.Reporting.WinForms.ServerReport.SetParameters method that sets report parameter properties for the report.
The following code example shows how to load a server report into the ReportViewer control and set parameters on the report.Code Block
Private Sub SetReportParameters()
'Set Processing Mode
ReportViewer1.ProcessingMode = ProcessingMode.Remote
' Set report server and report path
ReportViewer1.ServerReport.ReportServerUrl = _
ReportViewer1.ServerReport.ReportPath = _
"/AdventureWorks Sample Reports/Employee Sales Summary"
Dim pInfo As ReportParameterInfoCollection
Dim paramList As New Generic.List(Of ReportParameter)
paramList.Add(New ReportParameter("EmpID", "288", False))
paramList.Add(New ReportParameter("ReportMonth", "12", False))
paramList.Add(New ReportParameter("ReportYear", "2003", False))
pInfo = ReportViewer1.ServerReport.GetParameters()
' Process and render the report
2. You can also take a look at the article below:
This walkthrough shows how to create a simple table report in a Microsoft Visual Studio 2005 Windows application project based on the AdventureWorks sample database. You will add a report template to your project, set up connection information for the AdventureWorks database, define a query, add a table data region, and add a ReportViewer Windows Forms control to a Windows Form so the report can be viewed by users of the application.
Hope that can help you.
Saturday, December 08, 2007 7:59 AMThanks for reply.