Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Crystal Reports - Locking table
Message
From
05/08/1999 23:18:58
 
 
To
05/08/1999 15:16:34
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00250336
Message ID:
00250532
Views:
17
>Hi
>Using crystal reports from within a VFP automation server. The automation server creates a temporary data file, creates a crystal reports object, prints the report to file, releases the crystal reports object, and then attempts to delete the temporary data file.
>The automation server returns an error when attempting to delete the temp file, 'Access Denied'. It seems that the data file is locked even though the Crystal Reports object has been released. The file can only be deleted AFTER the VFP com server is destroyed (runtime) or after VFP is shut down (Interactive). I Don't understand why the file is locked - apparently by VFP.
>
>I need to be able to create the temporary files with the automation server, print the report, and delete the temp file before the server is destroyed.
>
>TIA
>Bill Sabo

Mine works fine. Here's my code:


loCRApp = CREATEOBJECT("Crystal.CRPE.Application")
* Call crystal reports to create the Agency report
loCrReport = loCRApp.OpenReport("D:\Work\AgLeads3.Rpt")
loCrDatabase = loCrReport.Database()
loCrExportOptions = loCrReport.ExportOptions()

* Set the Crystal Report options
loCrExportOptions.DestinationType = 1
loCrExportOptions.FormatType = 4
loCrExportOptions.DiskFileName = laAttach[lnAttach]
loCrReport.DiscardSavedData()
loCrReport.ParameterPromptingEnabled = .F.

* Create the RTF file
loCrReport.Export(.F.)

* Reset the CR Options
loCrExportOptions.Reset()

* Clear the report objects
loCrReport = .NULL.
loCrDataBase = .NULL.
loExportOptions = .NULL.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform