I have rs2005 on my machine, how can i do the webreference to Reportingservice2005.asmx
Dim rs As New ReportingService2005
I am getting an error when i am using the above dim statement, it says reportingservice2005 is not defined.
Please help thank you very much.
Where are you calling the web service from?
If it's from a VS solution (Web or forms) then you need to add the web reference there so it can create the proxy file.
|||To add a Web Reference in Visual Studio follow the steps listed on MSDN:
http://msdn2.microsoft.com/en-us/library/d9w023sx.aspx
The Url of the ReportingService2005.asmx will be in the ReportServer virtual directory, which is installed by default at http://<servername>/reportserver/reportingservice2005.asmx. If the ReportServer Url was changed you can find it by using the Reporting Services Configuration app.
HTH, Jason Tremper
|||Hello Jason,
I am using VS 2003 with RS 2005, and trying to webreference Reportingservice2005, but i don't find it
i do find just reportservice.asmx instead,
I used the reportingservice.asmx and it does work without anyproblem, but the report does'nt get displayed at all am i doing something wrong:
here is my code:
Dim rs As New ReportingService
Dim LogonCredentials As System.Net.NetworkCredential
Dim Items As CatalogItem
LogonCredentials = New System.Net.NetworkCredential("username", "password", "mydomainname")
rs.Credentials = LogonCredentials
'rs.Credentials = System.Net.CredentialCache.DefaultCredentials
rs.PreAuthenticate = True
' Render arguments
Dim result As Byte() = Nothing
Dim reportPath As String = "/PCSnetReports/StatusReport"
Dim format As String = "MHTML"
Dim historyID As String = Nothing
Dim devInfo As String = "<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>"
' Prepare report parameter.
Dim parameters(1) As ParameterValue
parameters(0) = New ParameterValue
parameters(0).Name = "eStatus"
parameters(0).Value = "All"
parameters(1) = New ParameterValue
parameters(1).Name = "UserName"
parameters(1).Value = "johnsmith" ' June
Dim credentials As DataSourceCredentials() = Nothing
Dim showHideToggle As String = Nothing
Dim encoding As String
Dim mimeType As String
Dim warnings As Warning() = Nothing
Dim reportHistoryParameters As ParameterValue() = Nothing
Dim streamIDs As String() = Nothing
Dim sh As New SessionHeader
rs.SessionHeaderValue = sh
Try
result = rs.Render(reportPath, format, historyID, devInfo, parameters, _
credentials, showHideToggle, encoding, mimeType, reportHistoryParameters, warnings, streamIDs)
sh.SessionId = rs.SessionHeaderValue.SessionId
Console.WriteLine("SessionID after call to Render: {0}", rs.SessionHeaderValue.SessionId)
Console.WriteLine("Execution date and time: {0}", rs.SessionHeaderValue.ExecutionDateTime)
Console.WriteLine("Is new execution: {0}", rs.SessionHeaderValue.IsNewExecution)
Catch e1 As SoapException
Console.WriteLine(e1.Detail.OuterXml)
End Try
' Write the contents of the report to an MHTML file.
Try
Dim stream As FileStream = File.Create("report.mhtml", result.Length)
Console.WriteLine("File created.")
stream.Write(result, 0, result.Length)
Console.WriteLine("Result written to the file.")
stream.Close()
Catch e2 As Exception
Console.WriteLine(e2.Message)
End Try
No comments:
Post a Comment