Link to home
Start Free TrialLog in
Avatar of AWestEng
AWestEngFlag for Sweden

asked on

Speed up crystal report load

Hi!

I'm having problem with the speed regarding loading of a crystal report to the report viewer.

Can I speed this up,?

Is it possible the "load" crystal report when starting the application so the first report will be faster to load

I'm using the crystal report that are implemented in VS 2005
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AWestEng

ASKER

oki was there any more code in that thread?
If you read the comments, you discover that they load a blank/dummy report just to have the DLLs in memory. It can also be done in a different thread.
It didn't help much to do that, it still takes alot of time to do the first report..

have i missed something.

I do this


 Public Sub New()

            Dim t As New Thread(AddressOf LoadCrystal)
            t.Priority = ThreadPriority.BelowNormal
            t.Start()
End sub

    Private Sub LoadCrystal()
        Dim crReport As New rptBlank

        Try
            crReport.Load()
        Catch ex As Exception
            Throw ex
        End Try
    End Sub
are you loading this dummy report when the application is starting?
you may also load the form that has the CR viewer on it because it is loading other DLLs.
oki.. but that form is in tool that i dock to the main form, so how do I solve that?
can't you just load the form without setting it to visible?
No i have stuff in the constuctor that sends stuff to the main form.

is there any other solution?
you can create a different constructor specifically for that task or create a different dummy form to load CR viewer DLLs.
I can test that.

I alos tested this but htat didn't solve the problem either

    Private Sub LoadCrystal()
        Dim crReport As New rptBlank
        Dim crReportViewer As New CrystalDecisions.Windows.Forms.CrystalReportViewer

        Try
            crReport.Load()
            crReportViewer.ReportSource = crReport
        Catch ex As Exception
            Throw ex
        End Try
    End Sub
Hmm i tested to open the form load a report, close the form opened the form again and load the report.

it was not faster the seconds time,

But if i load the a seconds report to the viwer (and not close it between the loads) then the report load  very fast, so I wonder, can I get the process any faster then i already has?