Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to call or integrate ssrs report with visual studio 2008

some one plz help me
Posted

1 solution

hi,

try this

Private Sub ShowReport()
Try '

'Set the processing mode for the ReportViewer to Remote
ReportViewer1.ProcessingMode = ProcessingMode.Remote

Dim urlReportServer As String = ConfigurationManager.AppSettings("SSRSServerUrl")


' ProcessingMode will be Either Remote or Local
ReportViewer1.ServerReport.ReportServerUrl = New Uri(urlReportServer)
'Set the ReportServer Url

ReportViewer1.ServerReport.ReportPath = "Report Path"

'Creating an ArrayList for combine the Parameters which will be passed into SSRS Report
Dim reportParam As New ArrayList()
reportParam = ReportDefaultPatam()

Dim param As Microsoft.Reporting.WebForms.ReportParameter() = New Microsoft.Reporting.WebForms.ReportParameter(reportParam.Count - 1) {}
For k As Integer = 0 To reportParam.Count - 1
param(k) = DirectCast(reportParam(k), Microsoft.Reporting.WebForms.ReportParameter)
Next


ReportViewer1.ServerReport.ReportServerCredentials = New ReportServerCredentials(reportserverUserName,reportserverPassword, domainname)



'pass parmeters to report
ReportViewer1.ServerReport.SetParameters(param)
'Set Report Parameters
ReportViewer1.ServerReport.Refresh()
Catch ex As Exception
Throw ex
End Try
End Sub

Private Function ReportDefaultPatam() As ArrayList
Dim arrLstDefaultParam As New ArrayList()
arrLstDefaultParam.Add(CreateReportParameter("para1",para1))
arrLstDefaultParam.Add(CreateReportParameter("para2", para1))

'arrLstDefaultParam.Add(CreateReportParameter("ReportSubTitle", "Sub Title of Report"))
Return arrLstDefaultParam
End Function
Private Function CreateReportParameter(ByVal paramName As String, ByVal pramValue As String) As Microsoft.Reporting.WebForms.ReportParameter
Dim aParam As New Microsoft.Reporting.WebForms.ReportParameter(paramName, pramValue)
Return aParam
End Function
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900