By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,290 Members | 1,263 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,290 IT Pros & Developers. It's quick & easy.

Convert .rpt to .pdf format?

P: n/a
How can I convert Crystal Report file (.rpt) to pdf format in Visaul
Basic 6?


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hi Jde,

If you can print your Crystal Report from Windows Explorer, and have a
PdfWriter printer driver, then you can use something like:

'In Shell.vb
Imports System.Diagnostics
Public Class Shell
Public Shared Sub Print (sFileName As String)
Dim p As New ProcessStartInfo()
p.FileName = sFileName
p.Verb = "print"
p.UseShellExecute = True
p.WindowStyle = ProcessWindowStyle.Hidden 'This may have no effect
Try
Process.Start(p)
Catch e As Exception
MsgBox ("Couldn't print " & p.FileName & vbCrLf & e.Message)
'or
Throw New Exception ("Couldn't print " & p.FileName, e)
End Try
End Sub
End Class

'Elsewhere
Shell.Print ("C:\Exciting\Some_Crystal_Report.rpt")

Regards,
Fergus
Nov 20 '05 #2

P: n/a
Hi Fergus,

I don't think this answers the issue. First, I see no conversion to .pdf -
to print the cr report and convert it inside cr is trivial, and he's not
asking that. Also, why should he need a pdfwriter driver? If you can
convert to .pdf inside cr, then cr has the driver internally, no? And since
you can do this inside cr, there must be a way to code it as part of the
object model of the reportdocument.

Bernie Yaeger

"Fergus Cooney" <fi******@tesco.net> wrote in message
news:uy*************@tk2msftngp13.phx.gbl...
Hi Jde,

If you can print your Crystal Report from Windows Explorer, and have a
PdfWriter printer driver, then you can use something like:

'In Shell.vb
Imports System.Diagnostics
Public Class Shell
Public Shared Sub Print (sFileName As String)
Dim p As New ProcessStartInfo()
p.FileName = sFileName
p.Verb = "print"
p.UseShellExecute = True
p.WindowStyle = ProcessWindowStyle.Hidden 'This may have no effect Try
Process.Start(p)
Catch e As Exception
MsgBox ("Couldn't print " & p.FileName & vbCrLf & e.Message) 'or
Throw New Exception ("Couldn't print " & p.FileName, e)
End Try
End Sub
End Class

'Elsewhere
Shell.Print ("C:\Exciting\Some_Crystal_Report.rpt")

Regards,
Fergus

Nov 20 '05 #3

P: n/a
Hi Bernie,

|| I see no conversion to .pdf - to print the cr report and convert it
|| inside cr is trivial

Sorry, Bernie I'm not sure I understand what you're saying. I've never
used Crystal Reports and have no idea what it can do. Are you saying that it
can convert to Pdf ??

|| Also, why should he need a pdfwriter driver?

The PdfWriter <printer> driver catches output printed from any program and
writes it to a Pdf file. This means that you don't need to have Pdf-capable
programs. Any program that prints can create a Pdf file.

My solution is a non-Crystal Reports one and is a fall-back assuming that
no-one else comes forward with a direct one. If Crystal Reports can handle
Pdfs internally, then sure, automation is the best way.

Regards,
Fergus
Nov 20 '05 #4

P: n/a
Cor
Hi Fergus,
How can I convert Crystal Report file (.rpt) to pdf format in Visaul
Basic 6? I know very few from VB6, does this work Try
Process.Start(p)
Catch e As Exception
MsgBox ("Couldn't print " & p.FileName & vbCrLf & e.Message) 'or
Throw New Exception ("Couldn't print " & p.FileName, e)
End Try

:-))))))))
Cor
Nov 20 '05 #5

P: n/a
"Jde001 jd001" <ke******@yahoo.com> schrieb
How can I convert Crystal Report file (.rpt) to pdf format in
Visaul Basic 6?


This is a VB.NET group (see group name). For older versions please turn to
one of the microsoft.public.vb.* groups.
--
Armin

Nov 20 '05 #6

P: n/a
Morning Cor,

LOL. Oops. Missed the VB6 bit!! :-)

Regards,
Fergus
Nov 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.