Last post Mar 03, 2015 09:19 AM by Mujeeb_Khan
Sep 28, 2010 11:42 AM|udayuddanti|LINK
I have two byte arrays from rdlc reports.
I need to create a pdf combining both the byte arrays.
My code is
string mimeType = string.Empty;
string encoding = string.Empty;
string extension = string.Empty;
bytes = rptViewer.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings);
bytes1 = RunReport(21316228, "82", 7);
byte combined = new byte[bytes.Length + bytes1.Length];
Array.Copy(bytes1, 0, combined, bytes.Length, bytes1.Length);
FileStream stream = new FileStream(savePath, FileMode.Create, FileAccess.ReadWrite);
stream.Write(combined, 0, combined.Length);
The RunReport function returns bytes1 which is generated from another rdlc report. I can see the size of combined byte is fine but its just printing the 2nd byte but not appending 1 and 2.
I tried various other codes using Buffer.BlockCopy etc.. similar to this but all of them yield the same result.
Some one please help me out!
Jan 18, 2011 06:33 PM|cooksd|LINK
Were you able to resolve this? I am trying to combine two reports in the same manner, but I get the same results as you: only the second byte() is rendered.
Feb 01, 2011 05:49 AM|cnranasinghe|LINK
Create 2 pdfs. use itextsharp to merge the report.
Mar 03, 2015 09:19 AM|Mujeeb_Khan|LINK
I have tried the same thing with itextsharp.
Dim pdfReader1 As New PdfReader(renderedBytes)
Dim pdfReader2 As New PdfReader(renderedBytes2)
Using finaloutput As MemoryStream = New MemoryStream()
Dim copy As PdfCopyFields = New PdfCopyFields(finaloutput)
Return File(finaloutput.ToArray(), "PDF", "test.pdf")