using HttpWebRequest to view reports

Discussion in 'ASP .Net' started by Mike P, Sep 28, 2006.

  1. Mike P

    Mike P Guest

    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();

    }




    *** Sent via Developersdex http://www.developersdex.com ***
     
    Mike P, Sep 28, 2006
    #1
    1. Advertising

  2. Mike P

    Joerg Jooss Guest

    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,
    --
    Joerg Jooss
     
    Joerg Jooss, Sep 28, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Barnes
    Replies:
    1
    Views:
    605
    J Jones
    Feb 18, 2004
  2. Peri
    Replies:
    1
    Views:
    3,099
    =?Utf-8?B?Um90aGFyaWdlcg==?=
    Jul 21, 2005
  3. Replies:
    2
    Views:
    955
  4. Parthiv Joshi
    Replies:
    1
    Views:
    821
    Samuel L Matzen
    Jul 6, 2004
  5. Replies:
    0
    Views:
    557
Loading...

Share This Page