Click here to Skip to main content
15,893,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to convert the ssrs byte array into an object

My Code:
C#
Byte[] wordOuptput = RequestReviewRptViewer.ServerReport.Render("word", deviceInfo, out mimeType, out encoding, out extension, out streamids, out warnings);

MemoryStream memStream = new MemoryStream(wordOuptput);               
BinaryFormatter binForm = new BinaryFormatter();
memStream.Write(wordOuptput, 0, wordOuptput.Length);
memStream.Seek(0, SeekOrigin.Begin);
Object obj = binForm.Deserialize(memStream);



getting error:
Binary stream '0' does not contain a valid BinaryHeader. Possible causes are invalid stream or object version change between serialization and deserialization.
Posted
Updated 11-Feb-14 0:03am
v2
Comments
johannesnestler 11-Feb-14 8:59am    
You guess the exception message is wrong? Seems to be a valid problem, If I had to guess I'd say RequestReviewRptView.ServerReport.Render didn't give you a valid byte-Array which represents a binary formatted object, no? What does the Debugger tell you?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900