Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Call a Crystal Report
Message
De
30/11/2001 13:05:54
 
 
À
28/11/2001 23:22:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
00586914
Message ID:
00588140
Vues:
27
See how do it. It's all bold.

>the following code works. not perfect. there are some things i still need tow work out. this does not show how to print or send to preview tho. sorry for the incompleteness. hope it helps - see some of my notes in here too.
>
>
>* Create the CR Object
>loCr = CREATEOBJECT("CrystalRuntime.Application")
>
>* Open the report (whatever you created in crystal)
>loCrRpt = loCr.OpenReport("c:\my documents\Report.rpt")
>
>* Set the data location (not sure why they do this - i have some trouble here)
loCrRpt.Database.Tables(1).location= "c:\xxxx.dbf"

** Delete the next 3 lines of code

>loCrData = loCrRpt.Database
>loCrTables = loCrData.Tables
>loCrTables.Item(1).Location = "c:\xxxx.dbf"
>
>* Set the export options
>loExportOptions = loCrRpt.ExportOptions
>loExportOptions.DestinationType = 1 && crEDTDiskFile
>
>* pdf output
> loExportOptions.FormatType = 31
> loExportOptions.DiskFileName = "c:\my documents\test.pdf"
> loCrRpt.DiscardSavedData()
> loCrRpt.Export(.F.)
>
>* excel output
> loExportOptions.FormatType = 29 && crEFTExcel80
> loExportOptions.DiskFileName = "c:\my documents\test.xls"
> loCrRpt.DiscardSavedData()
> loCrRpt.Export(.F.)
>
>* plain text file output
> loExportOptions.FormatType = 8
> loExportOptions.DiskFileName = "c:\my documents\test.txt"
> loCrRpt.DiscardSavedData()
> loCrRpt.Export(.F.)
>
>* html - doesn't work yet - not sure about "22"
> loExportOptions.FormatType = 22
> loExportOptions.DiskFileName = "c:\my documents\test.html"
> loCrRpt.DiscardSavedData()
> loCrRpt.Export(.F.)
>
>* Manual garbage collection
>loExportOptions = NULL
>loCrTables = NULL
>loCrData = NULL
>loCrRpt = NULL
>loCr = NULL
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform