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

  • SEARCH
  • Home
  • 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 8627109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:11:41+00:00 2026-06-12T08:11:41+00:00

I am new to crystal reports. I have been having this problem for quite

  • 0

I am new to crystal reports. I have been having this problem for quite some time and can’t seem to solve it. What I am doing is running a report and sending back the generated PDF in the response.

The problem is, when I run the asp.net page (which runs the report) from the browser it works fine for the first or second time but then after that, the browser just keeps waiting and I do not get any response back from the server, not even an error! It just keeps loading for a long time. I even did a clean re-install of the server but still have the same issue. I was not having this problem during initial testing of this page.

Crystal reports is being unpredictable and I am not sure if this is because the reports are not being closed properly or the connection is not proper.

Windows Server 2003 – IIS
Here is the vb.net page –

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim connectionInfo As New ConnectionInfo




        connectionInfo.ServerName = "UID=abc;PWD=abc;Driver= {SQL Server};Server=" & Page.Request.QueryString("server") & ";Database=" & Page.Request.QueryString("database")


    Using report As New ReportDocument
            report.Load(Server.MapPath("/report/Crystal/test.rpt"))
            report.FileName = Server.MapPath("/report/Crystal/test.rpt")

            SetDBLogonForReport(connectionInfo, report)

            report.SetParameterValue("param1",  Page.Request.QueryString("param1"))     



            Dim oStream As New MemoryStream()
            oStream = report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)

            Response.Clear()
            Response.Buffer = True
            Response.ContentType = "application/pdf"
            Response.BinaryWrite(oStream.ToArray())
            report.Close()
    End Using


        Response.Flush()
        Response.End()

    End Sub

    Private Sub SetDBLogonForReport(ByVal connectionInfo As ConnectionInfo, ByVal reportDocument As ReportDocument)

        Dim tables As Tables
        tables = reportDocument.Database.Tables

        For Each table As CrystalDecisions.CrystalReports.Engine.Table In tables

            Dim tableLogonInfo As New TableLogOnInfo

            tableLogonInfo = table.LogOnInfo
            tableLogonInfo.ConnectionInfo = connectionInfo
            table.ApplyLogOnInfo(tableLogonInfo)

        Next


    End Sub

</div>

</form>

  • 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-12T08:11:42+00:00Added an answer on June 12, 2026 at 8:11 am

    First off, put the call to report connection in the Page_Init() event, not Page_Load(). Prior to .NET 2005 it was okay to put it in Page_Load(). But now they changed how memory is managed and this can give you random errors depending upon the state of the CrystalReportViewer’s memory. Putting it in Page_Init() is safe all the time.

    Secondly, I would do is remove the code:
    CrystalReportViewer1.DataBind();

    I would also remove the RefreshReport() call b/c it refreshes itself automatically when you assign the report object to it. But it doesn’t hurt to have it. Either way, definitely get rid of the .DataBind() call.

    Hopefully these changes will get your application back to working.

    For more detail Please check below link I face same problem year ago. Hope it’s helpful
    LInk

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

Sidebar

Related Questions

I have been having this problem for quite some time. I create a dataset
I am a bit new to crystal reports even though I've been doing a
I have some Crystal Reports that were created using Crystal (external to Visual Studio)
I have this code import com.crystaldecisions.reports.sdk.ReportClientDocument; ... ReportClientDocument rpt = new ReportClientDocument(); rpt.open(reportPath+fileName, 0);
Not long ago, we switched to new Crystal Reports version, and I have a
hi i am new to crystal reports and ASP.NET I have a crystal report
I have a project with Crystal Reports files that doesn't seem to build correctly
I have a report that I created with Crystal Reports 2008. This report uses
I have a winforms applications that does some reporting using Crystal Reports for Visual
I am new to Crystal reports. I have to set the datasource of the

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.