Re: Preload Crystal Assemblies



Thanks for the code, I figured thats what had to be done.

JSantora wrote:
Charlie Brown wrote:
Is it possible to preload assemblies before they are called? Each time
the first report in my app runs, it takes 10-15 secs while it loads the
appropriate assemblies, after that any report that is run appears
immediatly.

Here you go...

' load up crystal when the app starts up.
' use a separate thread since its such a pig.
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")


' here's the code to load up a dummy report.
' this seems to load up and keep everything in memory throughout the
life of the app.

Public Sub LoadCrystal()
crReport = New ReportDocument

Try
' Need to preload crystal engine so the reports will print
quickly throughout the rest of the application.
' This report is not used, it is just loaded. Testing so
far 12/23/04 has not shown any
' problems such as memory or print errors.
crReport.Load(CrystalReportFolder & "rptBlank.rpt")

Catch ex As Exception
DisplayException(ex, "Error: Could find the startup Crystal
Report named 'rptBlank.rpt'." & _
vbCrLf & "If you are a new user, you may lack Server
permissions to read this directory and file: " & CrystalReportFolder &
"rptBlank.rpt" & _
vbCrLf & "Or the report may have been deleted or
corrupted. Please Call IT. [EJS0412311300]")
End Try
End Sub

.



Relevant Pages

  • Re: where will I notice negative side effects of bloat?
    ... Perhaps you just bind the report to a linked table and pass the parameters ... will it take longer to load the 20MB bloated app than it will to ... load the 8MB compacted app? ... you substantially increase the chances of corruption as now there are ...
    (comp.databases.ms-access)
  • Re: where will I notice negative side effects of bloat?
    ... recordsource for an Access report object. ... procedures which you believe cause the observed bloat? ... it sets up a querydef at the ... So, when one looks at the database window in the 8MB app, one sees the ...
    (comp.databases.ms-access)
  • Re: Crystal 9, ActiveX Viewer & .NET
    ... a VB.NET windows app than for a web application. ... app I can explain what was done however I can't explain for a web app. ... Install CR9 full install since you want to ... Create your report in CR and save it as an rpt file. ...
    (microsoft.public.vb.crystal)
  • Re: BusinessObjects automation
    ... but I got some info to clean up my syntax from a BO forum on the Tek-Tips site. ... >you're trying to refresh a BO report that that part of it isn't wacked ... I would surmise that the person who suggested that the app needed ... >> posts I see here. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Print jobs get out of order between workstation and printer
    ... After sending the report to the printer you have no control what windows ... Set the number of copies instead of printing 3 times. ... > We have an app running on WinXP workstations, app is hosted on a Win2003 ... Printer is connected to theWin2003 server. ...
    (microsoft.public.fox.programmer.exchange)

Loading