Anyone ever combined two Crystal Reports into one CrystalDecisions.CrystalReports.Engine.ReportDocument and streamed that combination out to a browser?
*WORKS ****************************************************************
Dim rpt1 As New CrystalReport1
Dim rpt As New ReportDocument
rpt.Load(Server.MapPath(rpt1.ResourceName))
rpt.SetDataSource(ds)
Dim crExportOptions As ExportOptions
crExportOptions = rpt.ExportOptions
With crExportOptions
.FormatOptions = New PdfRtfWordFormatOptions
.ExportFormatType = ExportFormatType.PortableDocFormat
End With
Dim req As ExportRequestContext = New ExportRequestContext
req.ExportInfo = crExportOptions
Dim st As System.IO.Stream
st = rpt.FormatEngine.ExportToStream(req)
Response.ContentType = "application/pdf"
Dim b(st.Length) As Byte
st.Read(b, 0, st.Length)
Response.BinaryWrite(b)
***********************************************************************
*DOESN'T WORK *********************************************************
Dim rpt1 As New CrystalReport1
Dim rpt2 As New CrystalReport2
Dim rpt As New ReportDocument
rpt.Load(Server.MapPath(rpt1.ResourceName))
rpt.Load(Server.MapPath(rpt2.ResourceName))
rpt.SetDataSource(ds)
Dim crExportOptions As ExportOptions
crExportOptions = rpt.ExportOptions
With crExportOptions
.FormatOptions = New PdfRtfWordFormatOptions
.ExportFormatType = ExportFormatType.PortableDocFormat
End With
Dim req As ExportRequestContext = New ExportRequestContext
req.ExportInfo = crExportOptions
Dim st As System.IO.Stream
st = rpt.FormatEngine.ExportToStream(req)
Response.ContentType = "application/pdf"
Dim b(st.Length) As Byte
st.Read(b, 0, st.Length)
Response.BinaryWrite(b)
***********************************************************************
*WORKS ****************************************************************
Dim rpt1 As New CrystalReport1
Dim rpt As New ReportDocument
rpt.Load(Server.MapPath(rpt1.ResourceName))
rpt.SetDataSource(ds)
Dim crExportOptions As ExportOptions
crExportOptions = rpt.ExportOptions
With crExportOptions
.FormatOptions = New PdfRtfWordFormatOptions
.ExportFormatType = ExportFormatType.PortableDocFormat
End With
Dim req As ExportRequestContext = New ExportRequestContext
req.ExportInfo = crExportOptions
Dim st As System.IO.Stream
st = rpt.FormatEngine.ExportToStream(req)
Response.ContentType = "application/pdf"
Dim b(st.Length) As Byte
st.Read(b, 0, st.Length)
Response.BinaryWrite(b)
***********************************************************************
*DOESN'T WORK *********************************************************
Dim rpt1 As New CrystalReport1
Dim rpt2 As New CrystalReport2
Dim rpt As New ReportDocument
rpt.Load(Server.MapPath(rpt1.ResourceName))
rpt.Load(Server.MapPath(rpt2.ResourceName))
rpt.SetDataSource(ds)
Dim crExportOptions As ExportOptions
crExportOptions = rpt.ExportOptions
With crExportOptions
.FormatOptions = New PdfRtfWordFormatOptions
.ExportFormatType = ExportFormatType.PortableDocFormat
End With
Dim req As ExportRequestContext = New ExportRequestContext
req.ExportInfo = crExportOptions
Dim st As System.IO.Stream
st = rpt.FormatEngine.ExportToStream(req)
Response.ContentType = "application/pdf"
Dim b(st.Length) As Byte
st.Read(b, 0, st.Length)
Response.BinaryWrite(b)
***********************************************************************