Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I using Crystal report from resources folder but not access
i have applied this

What I have tried:

Dim bytes() As Byte = My.Resources.RptFile
Dim Resource As IntPtr = Marshal.AllocCoTaskMem(bytes.Length)
RptDocument.Load(Resource)
Posted
Updated 5-Jun-20 1:43am

1 solution

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[^]
 
Share this answer
 
Comments
Maciej Los 5-Jun-20 7:46am    
5ed!

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