Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to export Crystal to PDF programically?
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00736365
Message ID:
00737537
Views:
37
This message has been marked as the solution to the initial question of the thread.
Hi Leeroy,

you can't export to PDF/XML through CR OLE. You have to use RDC:

This works for me:
	loCr = CREATEOBJECT("CrystalRuntime.Application")
	lcPDFReportName = 'ReportName.PDF'

	loCrRpt = loCr.OpenReport('ReportName.RPT')
	loCrData = loCrRpt.Database
	loCrTables = loCrData.Tables
	loCrTables.Item(1).Location = 'ReportData.DBF'
	loExportOptions = loCrRpt.ExportOptions
	loExportOptions.DestinationType = 1     && crEDTDiskFile
	loExportOptions.FormatType = 31		&& PDF
	loExportOptions.DiskFileName = lcPDFReportName
	loCrRpt.DiscardSavedData()
	loCrRpt.Export(.F.)

	loExportOptions = NULL
	loCrTables = NULL
	loCrData = NULL
	loCrRpt = NULL
	loCr = NULL
Sasha


>I am using the Crystal Reports OLE support provided with VFP. When using the export button during runtime, it does recognize the DLLs that I copied over for file types of PDF and XML.
>
>However, the numberic property "PrintFileType" does not support or recognize these DLLs.
>
>How can I specify programically to export as PDF, XML, etc?
Sasha Burkich
Consultant
Victoria, BC
Previous
Reply
Map
View

Click here to load this message in the networking platform