Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Crystal DSN error on direct VFP table?
Message
From
04/05/2004 11:19:13
 
 
To
04/05/2004 10:21:28
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00900714
Message ID:
00900777
Views:
7
The report was created using ODBC and you're trying to use direct access. Setup the DSN on the PC and it should work.


>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()
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Reply
Map
View

Click here to load this message in the networking platform