using HttpWebRequest to view reports

M

Mike P

I am using HttpWebRequest to view my reports (see code below). However,
I need to be able to pass parameters to the report in the code, and if
possible show graphs as well. Does anybody know how to do this?



protected void Page_Load(object sender, EventArgs e)

{

// Create a request for the URL.

WebRequest request =
WebRequest.Create("http://server/ReportServer?/Reports/AggregateOppsRepo
rt");

// If required by the server, set the credentials.

request.Credentials = CredentialCache.DefaultCredentials;

// Get the response.

HttpWebResponse response = (HttpWebResponse)request.GetResponse();

// Display the status.

//Console.WriteLine(response.StatusDescription);

// Get the stream containing content returned by the server.

Stream dataStream = response.GetResponseStream();

// Open the stream using a StreamReader for easy access.

StreamReader reader = new StreamReader(dataStream);

// Read the content.

string responseFromServer = reader.ReadToEnd();

// Display the content.

Response.Write(responseFromServer);

// Cleanup the streams and the response.

reader.Close();

dataStream.Close();

response.Close();

}
 
J

Joerg Jooss

Thus wrote Mike,
I am using HttpWebRequest to view my reports (see code below).
However, I need to be able to pass parameters to the report in the
code, and if possible show graphs as well. Does anybody know how to
do this?

I'm no Reporting Services expert, but assuming these require URL encoded
key/value pairs, you're much better off using WebClient.UploadValues().

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top