PDA

Click to See Complete Forum and Search --> : How to use CrystalReport object?


elbimbo
Jun 18th, 2003, 03:02 AM
Hello there,

I wanted to created a CrystalReport object during runtime.
Just like creating an ADO object.
it looks like this but this one doesnt run.

dim rptObj as CrystalReport

With rptObj
.Connect = "DSN=TEST;UID=sa;PWD=test;DSQ=Employee
.ReportFileName = App.Path & "\rptTST1.rpt"
.Formulas(0) = "ReportTitle="Test Report"
.SQLQuery = "SELECT * FROM Employee"
.PrintReport
End With

it generates an error variable is not set
pls help. thanks...

Joffies
Jun 18th, 2003, 04:28 AM
Add the following code...

set rptObj = New CrystalReport

elbimbo
Jun 18th, 2003, 04:43 AM
error says "invalid use of NEW keyword"

Joffies
Jun 20th, 2003, 04:23 AM
What version of crystal reports are u using and what references do you use in your project ....?