Quantcast
Channel: Crystal Reports
Viewing all articles
Browse latest Browse all 1507

How to export multiple Crystal Reports into one pdf format ?

$
0
0

Hi all

I have a crystal report document called "crdReport1"

Dim crdReport1 As New ReportDocument

crdReport1.Load(Server.MapPath("~/Reports/rptSales.rpt"))

dim oStream As MemoryStream = crdReport1.ExportToStream(ExportFormatType.PortableDocFormat)
    Response.Clear()
    Response.Buffer = True
    Response.ContentType = "application/pdf"
    Response.BinaryWrite(oStream.ToArray())
    Response.End()

This way It works fine.

I have another report Called "crdReport2" , I need to display it along with "crdReport1" in a single Report, showing combined pages from both reports.

I used the the code below but it didn't work:

Dim crdReport1 As New ReportDocument
Dim crdReport2 As New ReportDocument

crdReport1.Load(Server.MapPath("~/Reports/rptSales.rpt"))
crdReport2.Load(Server.MapPath("~/Reports/rptPurchaces.rpt"))

dim st1 As MemoryStream = crdReport1.ExportToStream(ExportFormatType.PortableDocFormat)
dim st2 As MemoryStream = crdReport2.ExportToStream(ExportFormatType.PortableDocFormat)
    Response.Clear()
    Response.Buffer = True
    Response.ContentType = "application/pdf"
    st2.CopyTo(st1)
    Response.BinaryWrite(st1.ToArray())
    Response.End()

It shows the first Report only.

Any Idea. I don't to create pdf files into server.

Thanx in advance


Viewing all articles
Browse latest Browse all 1507

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>