Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can you combine 2 pdfs using the ReportDocument object?

Status
Not open for further replies.

ikirkland

Programmer
Joined
Feb 27, 2002
Messages
16
Location
GB
I have a bit of code that exports 1 pdf, but was wondering if I could add another crystal report into a pdf file that I am currently creating. Or is there a better way to do it? Your help would be appreciated...

Dim crReportDocument As New ReportDocument()
Dim crExportOptions As New ExportOptions()
Dim crDiskFileDestinationOption As New DiskFileDestinationOptions()

Try
crReportDocument.Load(txtCrystalFilename.Text, OpenReportMethod.OpenReportByDefault)
crDiskFileDestinationOption.DiskFileName = txtPDFFilename.Text
crExportOptions = crReportDocument.ExportOptions
crExportOptions.DestinationOptions = crDiskFileDestinationOption
crExportOptions.ExportDestinationType = ExportDestinationType.DiskFile
crExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat
crReportDocument.Export()

MessageBox.Show("complete!")

Catch ex As Exception
MessageBox.Show(ex.ToString)

Finally
crReportDocument = Nothing
crExportOptions = Nothing
crDiskFileDestinationOption = Nothing

End Try
 
I'm pretty sure you can merge two PDF files with Adobe Acro Writer. Don't know how it would be done otherwise.

Does your method of exporting directly to a file (without utilizing the CR Viewer) work? If I re-write one of my VB6 apps this would be an important element of my program as well.

Thanks,

O.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top