Quantcast
Channel: VBForums - Reporting
Viewing all articles
Browse latest Browse all 594

Problems when printing to Crystal Reports

$
0
0
Hello!
I am a new member in this forum. First of all, sorry my little bad english...

I have a project made in Visual Basic 6, and printing reports from that project to Crystal Reports, vers. 9.
My code sample is below.
Problem is that application crashes occasionally (not always) when printing to .rpt.
Crash happen on the line which is bolded (..SetDataSource..)
Is there something wrong in my code? Any idea to solve this problem?

Dim crystal As CRAXDRT.Application
Dim Report As CRAXDRT.Report
Set crystal = New CRAXDRT.Application

Set Report = crystal.OpenReport("c:\MyPrints\print1.rpt", 1)
Report.DiscardSavedData
Report.Database.SetDataSource adoRst, 3
Report.PrintOut True, 1

Set Report = Nothing
Set crystal = Nothing

Viewing all articles
Browse latest Browse all 594

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>