cancel
Showing results for 
Search instead for 
Did you mean: 

how to Merge multiple report documents to a single pdf?

Former Member
0 Kudos

I am trying to export multiple report documents to a single pdf. I did the below code but my pdf is getting overwritten with the latest report document.

I have exported the report document of type pdf as bytes in memory stream array, and then storing the byte array to the pdf memory stream

Dim outstr() As MemoryStream = New MemoryStream(50) {}

Dim pdf As New MemoryStream

Dim byt() As Byte

For i as integer = 0 to tgrdShowEntry.SelectedItems.Count

outstr(i) = _rptDoc.ExportToStream(ExportFormatType.PortableDocFormat)

byt = outstr(i).ToArray()

pdf.Write(byt, 0, byt.Length)

Next

With HttpContext.Current.Response

.Clear()

.Buffer = True

.ContentType = "application/pdf"

.AddHeader("content-disposition", "attachment; filename=fname.pdf")

.OutputStream.Write(pdf.ToArray(), 0, pdf.length)

.End()

End With

Note: _rptDoc is a ReportDocument, tgrdShowEntry is a Radgrid

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Not possible using any CR SDK.

You will have to use 3rd party APIs to do this.

Ludek

Follow us on Twitter http://twitter.com/SAPCRNetSup

ido_millet
Active Contributor
0 Kudos

At least one of the 3rd-party Crystal Reports Desktop Scheduling tools listed at: http://www.kenhamady.com/bookmarks.html provides that functionality. It allows you to automate the process of exporting to pdf, merging any number of pdf files, optionally adding bookmarks to navigate the merged pdf file, and emailing the resulting merged file.

It provides a command line api for all of this, so you can trigger this processing from your own code.

Edited by: Ido Millet on Aug 26, 2010 12:34 PM

Former Member
0 Kudos

Thanks All for your suggestions

Answers (0)