Click here to Skip to main content
15,892,839 members
Articles / Programming Languages / SQL
Article

Crystal Reports To PDF converter Without Crystal Report Viewer

Rate me:
Please Sign up or sign in to vote.
1.08/5 (12 votes)
22 Jun 2006 112.4K   2.7K   35   15
Here You Can Convert Crystal Report To PDF

Introduction

Imports CrystalDecisions.CrystalReports.Engine

Imports CrystalDecisions.Shared

Public 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 memory

oRDoc.RecordSelectionFormula = sRecSelFormula 'used if u want pass the query to u r crystal form

oDfDopt.DiskFileName = strPdfFileDestinationPath 'path of file where u want to locate ur PDF

expo = oRDoc.ExportOptions

expo.ExportDestinationType = ExportDestinationType.DiskFile

expo.ExportFormatType = ExportFormatType.PortableDocFormat

expo.DestinationOptions = oDfDopt

oRDoc.SetDatabaseLogon("PaySquare", "paysquare") 'login for your DataBase

oRDoc.Export()

End Function

End Class

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Architect Smart wireless pvt ltd. Pune
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionHow to integrate this to current project Pin
Thameera Nawaratna21-Jan-18 19:07
professionalThameera Nawaratna21-Jan-18 19:07 
GeneralMy vote of 1 Pin
alex.barylski31-Jul-13 8:28
alex.barylski31-Jul-13 8:28 
What is this an aritcle or code snippet?
QuestionVB6 - convert crystal report to PDF - facing error Pin
SumithaNair27-Sep-11 20:34
SumithaNair27-Sep-11 20:34 
GeneralMy vote of 5 Pin
Member 308949229-Jun-10 22:00
Member 308949229-Jun-10 22:00 
Generalplease help Pin
ayunie28-Feb-07 20:44
ayunie28-Feb-07 20:44 
GeneralChanging database type at run time Pin
AlexEvans28-Nov-06 16:09
AlexEvans28-Nov-06 16:09 
Generalok.. I am new to this... Pin
vertigo196621-Sep-06 12:50
vertigo196621-Sep-06 12:50 
GeneralRe: ok.. I am new to this... Pin
satalaj26-Sep-06 2:25
satalaj26-Sep-06 2:25 
QuestionAre you serious? Pin
super4-Aug-06 11:33
professionalsuper4-Aug-06 11:33 
AnswerRe: Are you serious? Pin
satalaj26-Sep-06 2:24
satalaj26-Sep-06 2:24 
GeneralGood sample, slow output Pin
REBratton29-Jun-06 10:06
REBratton29-Jun-06 10:06 
GeneralRe: Good sample, slow output Pin
LiYunLong19-Sep-06 17:15
LiYunLong19-Sep-06 17:15 
GeneralRe: Good sample, slow output Pin
satalaj26-Sep-06 2:23
satalaj26-Sep-06 2:23 
GeneralRe: Good sample, slow output Pin
bamafanforlife30-Jan-07 4:51
bamafanforlife30-Jan-07 4:51 
GeneralRe: Good sample, slow output Pin
hannous5-Jun-07 2:30
hannous5-Jun-07 2:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.