Convert .rpt to .pdf format?

  • Thread starter Thread starter Jde001 jd001
  • Start date Start date
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
 
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
 
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
 
Jde001 jd001 said:
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.
 
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
 
Back
Top