I'm trying to use the OCX for Crystal Reports through Foxpro and I can get it to run with the stored data.
The report is a simple list, the database is exactly the same but I am changing it to look at another directory.
However, I can't get the syntax for changing the source database to work correctly. The code from the documentation says to use:
Report.DataFiles(ArrayIndex)[= Location$]
But when I run it, I get an OLE error code 0x80020006: Unknown name
crystalapplication = CreateObject("Crystal.CRPE.Application"
crystalReport = crystalApplication.OpenReport("C:\PFSAR\LOGIN.RPT"
**error on this line
crystalReport.DataFiles(0)="o:\pfsar\login.dbf"
**
crystalReport.ExportOptions.FormatType = 3
crystalReport.ExportOptions.DiskFileName = "c:\pfsar\test.txt"
crystalReport.ExportOptions.DestinationType = 1
crystalReport.Export(.t.)
Thanks in advance.
The report is a simple list, the database is exactly the same but I am changing it to look at another directory.
However, I can't get the syntax for changing the source database to work correctly. The code from the documentation says to use:
Report.DataFiles(ArrayIndex)[= Location$]
But when I run it, I get an OLE error code 0x80020006: Unknown name
crystalapplication = CreateObject("Crystal.CRPE.Application"
crystalReport = crystalApplication.OpenReport("C:\PFSAR\LOGIN.RPT"
**error on this line
crystalReport.DataFiles(0)="o:\pfsar\login.dbf"
**
crystalReport.ExportOptions.FormatType = 3
crystalReport.ExportOptions.DiskFileName = "c:\pfsar\test.txt"
crystalReport.ExportOptions.DestinationType = 1
crystalReport.Export(.t.)
Thanks in advance.