Click to See Complete Forum and Search --> : What is the best way to print a crystal report


Roy
March 12th, 1999, 01:20 PM
I am trying to print a report designed in crystal reports to print the contents of a database. I use the code


Private Sub cmdPrint_Click()

crReport.Action = crRunReport

End Sub


given in a book, but I get an error. Where am I going wrong and how do I rectify it

Carl Napoli
April 1st, 1999, 09:06 PM
You must specify the filename of the report file
(.rpt) you want to print.

With crReport
.Connect = CrystalReportConnectionString
.Destination = crptToPrinter
.ReportFileName = c:\reportname.rpt
.Action = 1
End With

P.S. Connect property is for user name, password, database name, server name, odbc source etc.
You must fill in the required info for the specific type of database you are connecting to.