getting 'System.IO.InvalidDataException' while loading byte array to the report
Posted: Mon Oct 04, 2010 3:42 pm
Am getting below exception error while trying to load a byte array to the report. Please let me know how can I resolve the problem. Appreciate a help
Exception Error
An unhandled exception of type 'System.IO.InvalidDataException' occurred in Stimulsoft.Report.dll
Additional information: The magic number in GZip header is not correct. Make sure you are passing in a GZip stream.
Here is the code snippet am using..
System.Windows.UIElement element = (System.Windows.UIElement)this.ImageCanvas.cadImage; (P.S : this is an image)
buffer = element.ToBitmap(15, 15).ToPNGBytes();
StiReport report = new StiReport();
report.Load(buffer);
report.ShowWithWpf();
Exception Error
An unhandled exception of type 'System.IO.InvalidDataException' occurred in Stimulsoft.Report.dll
Additional information: The magic number in GZip header is not correct. Make sure you are passing in a GZip stream.
Here is the code snippet am using..
System.Windows.UIElement element = (System.Windows.UIElement)this.ImageCanvas.cadImage; (P.S : this is an image)
buffer = element.ToBitmap(15, 15).ToPNGBytes();
StiReport report = new StiReport();
report.Load(buffer);
report.ShowWithWpf();