Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting a Crystal Report to a TXT file.

Status
Not open for further replies.

rshawtx

Programmer
Jul 26, 2002
6
US
Is there anyway to export a crystal report viewed through eportfolio into a text file? I have seen articles alluding to the fact that it can be done but none that show how to do it. The only formats that I see are PDF, DOC, RTF, and RPT. Thanks.
 
I wasn't aware that you could do this, perhaps if you have the FormatType and the .DLL installed it will work.

I found the following post here on Tek-Tips.

' Get the RPT file
Set ceInfoObjects = ceInfoStore.Query("Select SI_NAME, SI_UISTATUS, SI_FILES From CI_INFOOBJECTS Where SI_ID=" & Cstr(lInstanceID))

sFileSpec = "c:\temp\myReport.rpt"
ceInfoObjects.Item(1).Files.Item(1).CopyTo sFileSpec

' Export the RPT file to PDF
Set crApplication = CreateObject("CrystalRunTime.Application")
Set crReport = crApplication.OpenReport(sFileSpec)
crReport.DisplayProgressDialog = False
crReport.ExportOptions.DestinationType = 1 'Disk
crReport.ExportOptions.FormatType = 31 'PDF
crReport.ExportOptions.PDFExportAllPages = True
crReport.ExportOptions.DiskFileName = "c:\temp\myReport.pdf"
crReport.Export False 'Don't Prompt

' Free file handle and delete RPT file
Set crReport = Nothing
Set crApplication = Nothing
Set srFileSystem = WScript.CreateObject("Scripting.FileSystemObject")
srFileSystem.DeleteFile(sFileSpec)

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top