I have third party website which is using object of WebReportBroker and used CRviewer to view crystal report.I want to save this report in physical location in PDF format.Help me to how to do it?
A:
I don't know that "WebReportBroker" but this is how we execute a Crystal Report and then export it as pdf:
'---------------------------------------------------------
' Crystal Reports Constants
'---------------------------------------------------------
' ExportDestinationType
const crEDTNoDestination = "0"
const crEDTDiskFile = "1"
const crEDTEMailMAPI = "2"
const crEDTEMailVIM = "3"
const crEDTMicrosoftExchange = "4"
const crEDTApplication = "5"
const crEDTLotusDomino = "6"
' ExportFormatType
const crEFTCrystalReport = "1"
const crEFTCommaSeparatedValues = "5"
const crEFTWordForWindows = "14"
const crEFTHTML32Standard = "24"
const crEFTPortableDocFormat = "31"
const crEFTExcel97 = "36"
const crEFTXML = "37"
Const crEFTExcelDataOnly = "38"
dim oApp : set oApp = Server.CreateObject("CrystalRuntime.Application.10")
dim oRpt
dim CrystalExportOptions
dim crxdatabasetable
'1 - for processing
set oRpt = oApp.OpenReport("c:\reports\myReport.rpt", 1)
oRpt.MorePrintEngineErrorMessages = false
oRpt.EnableParameterPrompting = false
set CrystalExportOptions = oRpt.ExportOptions
CrystalExportOptions.DiskFileName = "myPDFReport.pdf"
CrystalExportOptions.FormatType = CInt(crEFTPortableDocFormat)
CrystalExportOptions.DestinationType = CInt(crEDTDiskFile)
oRpt.Export False
set oRpt = nothing
set oApp = nothing
ulluoink
2010-08-29 11:32:33