Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using OLE DB with Crystal Reports 9
Message
 
À
27/11/2002 15:48:39
Fabian Valencia
Calamos Asset Managment Inc.
Naperville, Illinois, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Crystal Reports
Divers
Thread ID:
00727754
Message ID:
00728901
Vues:
23
Hi Fabian,

The following code runs error free on Crystal 8.5 and VFP8 using a free table to drive the report:

SET STEP ON
*
* initialize runtime objects
*
cReportFile = 'c:\vfpbeta\report2.rpt'
IF FILE(cReportFile)
*
* crystal application object
*
IF TYPE('oCrApplication') = 'U'
PUBLIC oCrApplication
oCrApplication = CREATEOBJECT('CrystalRuntime.Application')
ENDIF
*
* crystal report object
*
IF TYPE('oCrReport') = 'U'
PUBLIC oCrReport
oCrReport = CREATEOBJECT('CrystalRuntime.Report')
ENDIF
*
* update report object properties
*
oCrReport = oCrApplication.OpenReport(cReportFile) && open .rpt file
*
* loop through tables and set OLE DB server name
*
WITH oCrReport.Database
FOR nTableNo = 1 TO .Tables.Count
.Tables(nTableNo).Location = GETFILE() && location of free table
ENDFOR
ENDWITH
oCrReport.ExportOptions.DestinationType = 1 && Export the report to a file
oCrReport.ExportOptions.FormatType = 1 && Set the format
oCrReport.ExportOptions.DiskFileName = GETFILE() && Export file path
oCrReport.Export(.F.) && Export
ELSE
nResult = MESSAGEBOX('Could not locate specified report format.',16,'System Message')
RETURN .F.
ENDIF

If this doesn't run on Crystal 9 then maybe you should open a ticket w/ Crystal Decisions to find out why. Or, maybe consider reverting to Crystal 8.5. From what I saw, there wasn't anything in v9 that was particularly compelling. Don't know your situation...

Good luck,
Jeff
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform