SAP Knowledge Base Article - Public

1439745 - How to improve performance of a Crystal Report in VB. NET application on load of first report.

Symptom

  • Processing of first report in a Visual Studio .NET is slower than when the report is loaded in the Crystal Reports Designer
  • Subsequent reports are processed equivalently to the Report Designer

Cause

See the article "Improving Crystal Reports Performance in Visual Studio .NET Applications" for discussesion of causes and possible solutions.

Resolution

A resolution not documented in the article referenced under the "Cause" tab is documented below

'Use a separate thread to load a report which will load and initialize the Crystal Reports runtime 
 
            TraceWriteLine("starting Crystal Reports Thread")
             myTimer = New FunctionTimer("load crystal")
             Dim t As New Thread(AddressOf LoadCrystal)
             t.Priority = ThreadPriority.BelowNormal
             t.Start()
             myTimer.EndTimer()
             TraceWriteLine("...thread started")
 
 
'Load up a dummy report - no database connection required
     Public Sub LoadCrystal()
         crReport = New ReportDocument
 
      Try
' This report is not used, it is just loaded.
             crReport.Load("path to a report")
 
         Catch ex As Exception
             DisplayException(ex, "Error String"
         End Try
     End Sub

Keywords

slow, performance, load, fast, faster, runtime, first , KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , How To

Product

SAP Crystal Reports XI R2