Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9046187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:35:48+00:00 2026-06-16T11:35:48+00:00

I have made a SSRS Bulk reporter that queries a report from SSRS using

  • 0

I have made a SSRS Bulk reporter that queries a report from SSRS using a HTTPWebRequest and a HTTPWebResponse to get the stream and save it as a file to a PDF.

However, the client has complained that this is taking long. I have tested it, and this function is taking +- 15.5seconds. If I put a break in-between the GetResponseStream and the file-writer, and I wait for about 3 seconds before stepping to the next part, it shaves 4 seconds off the total time?

Can anyone explain this/or give some advise as to make it a bit faster?

This is the function:

 Public Function ExportReport(ByVal QueryStringParameters As String, ByVal FileName As String) As String
    Dim PDFName As String = ReportFolderPath & FileName & ".pdf"
    'Create a http request or connecting to the report server.
    Dim ReportHTTPRequest As HttpWebRequest = Nothing
    'Create a http response to catch the data stream returned from the http request.
    Dim ReportHTTPResponse As HttpWebResponse = Nothing
    'Create a stream to read the binary data from the http reponse.
    Dim ReportStream As Stream = Nothing
    Dim ReportFileStream As FileStream = Nothing
    'Create an array of bytes to get the binary data from the stream.
    Dim ReportBytes As Byte()
    Dim ReportBuffer As Integer = 204800
    Dim ReportBytesRead As Integer = 0


    'Create a webrequest to get the report with all the report parameters included.
    ReportHTTPRequest = WebRequest.Create(ReportServerURL & QueryStringParameters)
    ReportHTTPRequest.Credentials = CredentialCache.DefaultCredentials
    'Get the response from the request.

    ReportHTTPResponse = ReportHTTPRequest.GetResponse()

    'Read the binary stream from the http response.
    ReportStream = ReportHTTPResponse.GetResponseStream()

    ReportBytes = New Byte(ReportBuffer) {}
    ReportBytesRead = ReportStream.Read(ReportBytes, 0, ReportBuffer)
    ReportFileStream = New FileStream(PDFName, FileMode.Create)
    Do While ReportStream.CanRead And ReportBytesRead > 0
        ReportFileStream.Write(ReportBytes, 0, ReportBytesRead)
        ReportBytesRead = ReportStream.Read(ReportBytes, 0, ReportBuffer)
    Loop

    ReportHTTPResponse.Close()
    ReportStream.Close()
    ReportFileStream.Close()

    Return PDFName
End Function
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T11:35:55+00:00Added an answer on June 16, 2026 at 11:35 am

    a magic thing that worked for me, try a buffer size of 32768

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a code that read data from flash Nand (without filesystem). fd
I have made an application that can render and save a given element. With
I have a report (SSRS 2008 r2) that is used to report on enquiries
I have made an Android app that has an external database, using WAMP and
I am not a seasoned SSRS veteran. I have made quite a few but
I have made a jQuery toggle for a menu that I had in mind.
I have made a website using( Asp.net, c# ) and its content in English
I have made a String[] array by using String.split(.) . I am now trying
I have made one c# application For estate Agent Management. In that application i
I have made a custom jQuery carousel from bits I have picked up off

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.