all groups > sql server reporting services > august 2004 >
You're in the

sql server reporting services

group:

Streaming Report HTML Response


Streaming Report HTML Response Abdul Malik Said
8/27/2004 5:14:51 PM
sql server reporting services:
I am trying to write C# .NET code to stream a report without using the SOAP
Reporting Services tools. (There is a reason for not using SOAP in my case.)

I am using the System.IO.WebRequest class to get the response from the
server

Here is my code:

WebRequest request = WebRequest.Create(
"http://betta/ReportServer?%2fReports%2fReportName" );
WebResponse response = request.GetResponse();

When it executes, it returns

Error(401) Unauthorized

Is there something I need to set in the report permissions to change this? I
can see the report if I just copy and paste that url to the browser.

Or maybe there is a better way to do this without SOAP...

Thanks,
Malik

Re: Streaming Report HTML Response Abdul Malik Said
8/27/2004 5:37:32 PM
Actually, I solved my own problem. It was using anonymous login, so I just
changed it to the following:



WebRequest request = WebRequest.Create(
"http://localhost/ReportServer?%2fInphase+Reports%2fObjective-Measure%20Pair
s" );

request.Credentials = CredentialCache.DefaultCredentials;

WebResponse response = request.GetResponse();



It works! try it...

[quoted text, click to view]

AddThis Social Bookmark Button