I Have 4-5 RDLC which i want to write in Word Document. I have converted every RDLC to byte array then i am combining two byte array to single byte array but memory stream writing only first array. Can anyone assist here ? Please find below code which i am trying
{
byte[] FirstLetter = DownloadFirstLetter(assigneeId); //First RDLC to byte[]
byte[] SecondLetter = DownloadSecondLetter(assigneeId);//Second RDLC to byte[]
MemoryStream stream = new MemoryStream();
byte[] t = Combine(FirstLetter , SecondLetter );
stream.Write(t, 0, t.Length);
stream.Position = 0;
using (FileStream file = new FileStream(mDesPath + fileName, FileMode.Create, FileAccess.Write))
{
stream.WriteTo(file);
}
}
public static byte[] Combine(byte[] first, byte[] second)
{
byte[] bytes = new byte[first.Length + second.Length];
Buffer.BlockCopy(first, 0, bytes, 0, first.Length);
Buffer.BlockCopy(second, 0, bytes, first.Length, second.Length);
return bytes;
}