Calling report created from SQL Server Reporting Services

susie

New member
Joined
Jul 5, 2004
Messages
4
Programming Experience
3-5
Hi there,

Can anyone teach me how to call a report created from SQL Server Reporting Services in an aspx page? I have a created report named report1.rdl.

Thank you for the help in advance. :)
 

karanamravindra

New member
Joined
Oct 18, 2004
Messages
1
Programming Experience
1-3
There are two methods of achieving this.

Method 1 (Using Reportviewer Control):

Add Reference to reportviewer.dll from Samples of reporting server.
(or Check in help of reporting services online books)
ReportViewer1.serverURl="http://localhost/Reportserver"
ReportViewer1.ReportPath = "/sampleProj/report1"

Method 2:

Give the reference for the webservice from your local machine and do the following,

In this example i am sending the value 6 to the report as parameter for SID, which is present in the report2

Dim rs As New ReportingService

Dim parameters(0) As ParameterValue

Dim devInfo As String = <DeviceInfo><JavaScript>False</JavaScript><Section>0</Section><HTMLFragment>True</HTMLFragment><Zoom>Page Width</Zoom></DeviceInfo>"

parameters(0) = New ParameterValue
parameters(0).Name = "SID"
parameters(0).Value = "6"

Dim results As Byte()
results = rs.Render("/Reportservices/report2", "HTML4.0", Nothing, devInfo, parameters, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing)
Response.BinaryWrite(results)

All the best

Karanam
 

susie

New member
Joined
Jul 5, 2004
Messages
4
Programming Experience
3-5
thank you karanamravindra,

Though reply was late, it would surely help me specially the second option you gave.

Thanks.
 
Top Bottom