Click here to Skip to main content
16,020,990 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I have two parameter one is id and another is group id

if group id is 3 I want to open report
A if group id is 5 I want to open report B I am calling this report in my aspx page.

Is there any way we can do without passing the groupid number directly in the aspx page.

right now my code looks like

Private Function GetReportFileContent() As Byte()

Dim reportPath As String = ConfigurationManager.AppSettings("A" & MyApp.ActiveServerEnvironment.ToString.ToLower)

Dim report As New Reporting.Report


report.ReportParameters = Reporting.Report.ParseReportParameters("ServiceGroupId=10")
report.ReportParameters = Reporting.Report.ParseReportParameters("CVID=" & MyVisitId)
report.SSRSParameters = MyApp.GetSSRSParameters
report.Path = "http://HRWOBSQL04:80/reportserver/" & TextUtil.ReplaceFirst(reportPath, "/", String.Empty)


'printing report
Dim url1 = "http://hrwobweb02/AOHIntranetApps/VisitManager" & "/global/pages/ReportViewer.aspx?reportPath=" & reportPath & "10"
Dim url2 = "http://hrwobweb02/AOHIntranetApps/VisitManager" & "/global/pages/ReportViewer.aspx?reportPath=" & reportPath & "&reportParams=" & MyVisitId + ""
rvAOHRC.ServerReport.ReportServerUrl = New Uri("http://HRWOBSQL04:80/reportserver/")
rvAOHRC.ServerReport.ReportServerCredentials = report.SSRSParameters.ReportCredentials
rvAOHRC.ServerReport.ReportPath = reportPath
rvAOHRC.ProcessingMode = ProcessingMode.Remote ' Me.ProcessingMode
rvAOHRC.ServerReport.SetParameters(report.ReportParameters)
'MyReport = report

Dim oReportService As New SSRSReportService.ReportExecutionService()
Dim oExecutionInfo As New SSRSReportService.ExecutionInfo
Dim oExecutionHeader As New SSRSReportService.ExecutionHeader()

oReportService.Credentials = report.SSRSParameters.ReportCredentials.NetworkCredentials
oReportService.Timeout = 30000
oReportService.Url = "http://HRWOBSQL04:80/reportserver/ReportExecution2005.asmx"

Dim paramValues(0 To report.ReportParameters.Count - 1) As SSRSReportService.ParameterValue

Dim paramIndex As Integer
For Each param As ReportParameter In report.ReportParameters
Dim paramVal As New SSRSReportService.ParameterValue
paramVal.Name = param.Name
paramVal.Value = param.Values(0)
paramValues(paramIndex) = paramVal
paramIndex += 1
Next

oReportService.ExecutionHeaderValue = oExecutionHeader
oExecutionInfo = oReportService.LoadReport(reportPath, Nothing)

oReportService.SetExecutionParameters(paramValues, "en-us")

Return oReportService.Render("PDF", "<deviceinfo><toolbar>False", String.Empty, String.Empty, String.Empty, Nothing, Nothing)

End Function

How to pass the groupid and get the report B and A. Right now I can only print group A Also getting conversion error.
Can anybody help.

Thanks

Mary
Posted
Updated 6-Apr-15 10:58am
v3

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