I created a pdf document to store the subreport information (it contains patient information as a header at the top of the document), and I want to add it to another pdf document. This subreport is generated from an SSRS server report. If I do a merge, the subreport document contains a page break, which I don't want. So what is the correct way to go about this?
I generate the report from the report server into a byte array, and then put that into a memory stream which I then create the EO Pdf document from it:
Code: Visual Basic.NET
rptGenerator.Extension = ReportGenerator.ExtensionTypes.PDF
rptGenerator.ReportServerURL = ConfigurationManager.AppSettings("ReportServerURL")
rptGenerator.ReportServerReportPath = ConfigurationManager.AppSettings("ReportServerReportPath")
rptGenerator.ReportName = "rptPAT_FAC_Portrait"
'Generate Patient Header pdf.
rptParams.Add(New ReportParameter("PAT_ID", Me.ActivePatientId))
rptParams.Add(New ReportParameter("CUR_PAGE", "1"))
rptParams.Add(New ReportParameter("TOT_PAGE", "1"))
rptParams.Add(New ReportParameter("CHART_DATE", DateTime.Now.ToShortDateString))
rptGenerator.SetParameters(rptParams)
PAT_HEADER_BYTES = rptGenerator.GenerateReport()
'Setup PDF doc of MAR_NEW
Using ms As MemoryStream = New MemoryStream(PAT_HEADER_BYTES)
docPAT_HEADER = New PdfDocument(ms)
End Using
I merge the two EO.Pdf documents later in the code:
Code: Visual Basic.NET
HtmlToPdf.ConvertHtml(htmlOutput, doc)
docCOMPLETE = PdfDocument.Merge(docPAT_HEADER, doc)
But this isn't really what I want. I want *one* document that has the docPAT_HEADER at the top, and the rest of doc after it.
Can you help me? :)