Click here to Skip to main content
15,843,200 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 111.7K   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 20:07
professionalThameera Nawaratna21-Jan-18 20:07 
GeneralMy vote of 1 Pin
alex.barylski31-Jul-13 9:28
alex.barylski31-Jul-13 9:28 
QuestionVB6 - convert crystal report to PDF - facing error Pin
SumithaNair27-Sep-11 21:34
SumithaNair27-Sep-11 21:34 
GeneralMy vote of 5 Pin
Member 308949229-Jun-10 23:00
Member 308949229-Jun-10 23:00 
Generalplease help Pin
ayunie28-Feb-07 21:44
ayunie28-Feb-07 21:44 
GeneralChanging database type at run time Pin
AlexEvans28-Nov-06 17:09
AlexEvans28-Nov-06 17:09 
Generalok.. I am new to this... Pin
vertigo196621-Sep-06 13:50
vertigo196621-Sep-06 13:50 
GeneralRe: ok.. I am new to this... Pin
satalaj26-Sep-06 3:25
satalaj26-Sep-06 3:25 
just call the dll present in Bin Folder. (Design time or run time)
QuestionAre you serious? Pin
super4-Aug-06 12:33
professionalsuper4-Aug-06 12:33 
AnswerRe: Are you serious? Pin
satalaj26-Sep-06 3:24
satalaj26-Sep-06 3:24 
GeneralGood sample, slow output Pin
REBratton29-Jun-06 11:06
REBratton29-Jun-06 11:06 
GeneralRe: Good sample, slow output Pin
LiYunLong19-Sep-06 18:15
LiYunLong19-Sep-06 18:15 
GeneralRe: Good sample, slow output Pin
satalaj26-Sep-06 3:23
satalaj26-Sep-06 3:23 
GeneralRe: Good sample, slow output Pin
bamafanforlife30-Jan-07 5:51
bamafanforlife30-Jan-07 5:51 
GeneralRe: Good sample, slow output Pin
hannous5-Jun-07 3:30
hannous5-Jun-07 3: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.