General information
Category:
Third party products
i've got crystal 8.5 developer edition installed on my machine.
here's the code i'm using.
even with "24" for html, i still get a defective output.
actually, not sure what to do fro print and preview cases below either.
and i'm still having trouble with the data location.
if i use the code below and move or rename the data tables that are
used in the report, it crashes. i want the user to be able to move
the data to another location and not worry about where it is.
if the report can't find it, then i want to put up a dialog for the
user to locate it. i know how to do that, but i don't know how to tell
the report where the data is located in the vfp code.
and again, i know how to use the "selectioncriteria" with the active x
control, but how do you do that here???
thanks,
keith
----------------------------------------------------------------
* Create the CR Object
loCr = CREATEOBJECT("CrystalRuntime.Application")
* Open the report
loCrRpt = loCr.OpenReport("E:\IMNewVer\TestArea\Report.rpt")
* Set the data location
loCrData = loCrRpt.Database
loCrTables = loCrData.Tables
loCrTables.Item(1).Location = "E:\IMNewVer\Data\demoord.dbf"
loCrTables.Item(2).Location = "E:\IMNewVer\Data\supplies.dbf"
* Set the export options
loExportOptions = loCrRpt.ExportOptions
do case
case thisform.outputtype.value = 1 && print
case thisform.outputtype.value = 2 && preview
case thisform.outputtype.value = 3 && PDF
loExportOptions.DestinationType = 1 && crEDTDiskFile
loExportOptions.FormatType = 31
loExportOptions.DiskFileName = "E:\IMNewVer\TestArea\test.pdf"
case thisform.outputtype.value = 4 && text
loExportOptions.DestinationType = 1 && crEDTDiskFile
loExportOptions.FormatType = 8
loExportOptions.DiskFileName = "E:\IMNewVer\TestArea\test.txt"
case thisform.outputtype.value = 5 && excel
loExportOptions.DestinationType = 1 && crEDTDiskFile
loExportOptions.FormatType = 29 && crEFTExcel80
loExportOptions.DiskFileName = "E:\IMNewVer\TestArea\test.xls"
case thisform.outputtype.value = 6 && html
loExportOptions.DestinationType = 1 && crEDTDiskFile
loExportOptions.FormatType = 24 && 24 or 32 ???
loExportOptions.DiskFileName = "E:\IMNewVer\TestArea\test.html"
case thisform.outputtype.value = 7 && rtf
loExportOptions.DestinationType = 1 && crEDTDiskFile
loExportOptions.FormatType = 4
loExportOptions.DiskFileName = "E:\IMNewVer\TestArea\test.rtf"
otherwise
=messagebox("Invalid selection.")
endcase
loCrRpt.DiscardSavedData()
loCrRpt.Export(.F.)
* Manual garbage collection
loExportOptions = NULL
loCrTables = NULL
loCrData = NULL
loCrRpt = NULL
loCr = NULL
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only