on 08-26-2010 3:33 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.