Crystal Reports To PDF converter Without Crystal Report Viewer






1.43/5 (8 votes)
Jun 23, 2006

113444

2705
Here You Can Convert Crystal Report To PDF
Introduction
Imports
CrystalDecisions.CrystalReports.EngineImports
CrystalDecisions.SharedPublic
Class clsCrystalToPDFConverter Dim ConInfo As New CrystalDecisions.Shared.TableLogOnInfo Dim oRDoc As New ReportDocument Dim expo As New ExportOptions Dim sRecSelFormula As String Dim oDfDopt As New DiskFileDestinationOptions Dim strCrystalReportFilePath As String Dim strPdfFileDestinationPath As String Public Function SetCrystalReportFilePath(ByVal CrystalReportFileNameFullPath As String)strCrystalReportFilePath = CrystalReportFileNameFullPath
End Function Public Function SetPdfDestinationFilePath(ByVal pdfFileNameFullPath As String)strPdfFileDestinationPath = pdfFileNameFullPath
End Function Public Function SetRecordSelectionFormula(ByVal recSelFormula As String)sRecSelFormula = recSelFormula
End Function Public Function Transfer()oRDoc.Load(strCrystalReportFilePath)
'loads the crystalreports in to the memoryoRDoc.RecordSelectionFormula = sRecSelFormula
'used if u want pass the query to u r crystal formoDfDopt.DiskFileName = strPdfFileDestinationPath
'path of file where u want to locate ur PDFexpo = oRDoc.ExportOptions
expo.ExportDestinationType = ExportDestinationType.DiskFile
expo.ExportFormatType = ExportFormatType.PortableDocFormat
expo.DestinationOptions = oDfDopt
oRDoc.SetDatabaseLogon("PaySquare", "paysquare")
'login for your DataBaseoRDoc.Export()
End FunctionEnd
Class