PatMcLaughlin
Programmer
I have created a cursor (DBINFO) and copied data into it to use in a crystal report form stored in the C:\ drive of the computer running this file. I need it to create a pdf from the data in the cursor.
* Create ADO recordset, and copy DBINFO cursor data into it
loVFPCom = CreateObject("Vfpcom.Comutil")
loDBINFO = CreateObject("ADODB.Recordset")
lnError = loVFPCom.CursorToRS(loDBINFO, "DBINFO")
* Create report object and connect to datasource
loCrystal=CreateObject("CrystalRuntime.Application")
loReport=loCrystal.OpenReport("c:\vfp\ka\runtime\wrrept04.rpt",1)
loReport.Database.Tables(1).SetDataSource(loDBINFO, 3)
loReport.ExportOptions.DestinationType = crEDTDiskFile
loReport.ExportOptions.FormatType = crEFTPortableDocFormat
loReport.ExportOptions.DiskFileName = lcFileName
loReport.Export(.F.)
It works fine to the last line (loReport.Export(.F.)) then shoots out the following error
OLE IDispatch exception code 0 from Crystal Reports ActiveX Designer: A number is required hereOLE IDispatch exception code 0 from Crystal Reports ActiveX Designer: A number is required here.
This code works for many other applications in this program but not this time. I'm stumped.
* Create ADO recordset, and copy DBINFO cursor data into it
loVFPCom = CreateObject("Vfpcom.Comutil")
loDBINFO = CreateObject("ADODB.Recordset")
lnError = loVFPCom.CursorToRS(loDBINFO, "DBINFO")
* Create report object and connect to datasource
loCrystal=CreateObject("CrystalRuntime.Application")
loReport=loCrystal.OpenReport("c:\vfp\ka\runtime\wrrept04.rpt",1)
loReport.Database.Tables(1).SetDataSource(loDBINFO, 3)
loReport.ExportOptions.DestinationType = crEDTDiskFile
loReport.ExportOptions.FormatType = crEFTPortableDocFormat
loReport.ExportOptions.DiskFileName = lcFileName
loReport.Export(.F.)
It works fine to the last line (loReport.Export(.F.)) then shoots out the following error
OLE IDispatch exception code 0 from Crystal Reports ActiveX Designer: A number is required hereOLE IDispatch exception code 0 from Crystal Reports ActiveX Designer: A number is required here.
This code works for many other applications in this program but not this time. I'm stumped.