Your code makes no sense. You allocate some unmanaged memory large enough to store the report bytes, but you never initialize it. You then pass an
IntPtr
to a method which expects a
String
containing the report path.
There doesn't seem to be a way to load a Crystal Reports file from an in-memory representation. You'll need to save the report to a temporary file, and load it from there.
wpf - How to load .rpt crystal report file which is a resource in current project - Stack Overflow[
^]