General information
Category:
Reports & Report designer
Title:
Crystal DSN error on direct VFP table?
Hello Everyone,
We are trying to do a proof of concept on using Crystal reports to generate reports from within VFP 6.0.
As a start I am using code at the bottom of this message. FWIW, rptoutputsest.RPT is a simple list. I just wanted to confirm that we can call Crystal from within VFP 6.0 and get a report to print. When I run this little test, I get this error on the oRpt.Printout() line -
OLE IDispatch eception code 0 from Crystal Reports Activex Designer: Query Engine Error: 'Cannot find DSN in connection string'...
Ultimately we want to create a Crystal report with a pie chart, but we have to get past this first. Another programmer created the .RPT file, and he assures me that the only table he references is the VFP table, which he has set up as a direct table and created as type FOX2X. However, I can't absolutely confirm this as I have not seen the .RPT itself.
Thanks,
Mike Kiser
******* Code *********************
oCR = CREATEOBJECT('CrystalRuntime.Application')
oRpt = oCR.OpenReport("i:\data\cr\rptoutputtest.rpt")
IF oRpt.HasSavedData
oRpt.DiscardSavedData()
ENDIF
* Create the Database object
oDB = oRpt.Database()
* Get a references to the DatabaseTables collection
ocDBT = oDB.Tables()
* Get a reference to the DatabaseTable object for table 1
oDBT = ocDBT.Item(1)
* Set the location
oDBT.Location = "i:\data\cr\contact.DBF"
oRpt.PrintOut()
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only