all groups > dotnet datatools > august 2005 >
You're in the

dotnet datatools

group:

Crystal Reports from Class Library


Crystal Reports from Class Library kurt.craver NO[at]SPAM gmail.com
8/29/2005 12:41:35 PM
dotnet datatools:
I have several modules that have Crystal Reports classes in them. When
the modules are compiled as a Windows Application, the reports can be
instantiated and displayed without any problems.

When a module is compiled as a Class Library, and then the parent frame
is instantiated from another assembly, all of the reports give this
error when they are instantiated:

An unhandled exception of type
'System.Runtime.InteropServices.MarshalDirectiveException' occurred in
crystaldecisions.crystalreports.engine.dll

Additional information: Marshaler restriction: Excessively long string.

Is there any way to get a Crystal Reports object to instantiate
properly from a Class Library application?

-Kurt
Re: Crystal Reports from Class Library Metal2You
8/30/2005 6:13:17 AM
Well it seems the fact that the report is in a Class Library isn't what
is causing the problem. I did a test with a simple report and was able
to instantiate it from a class library.

I still have no idea what the cause of the problem is though.
Re:Crystal Reports from Class Library Andre Rog
9/28/2005 5:53:23 PM
I had exactly the same problem and firstly I didn't find any hint on the net.

After some hours of nightmare, I finally found the problem (the experts
would add: but not the cause to the problem):
My "parent"-windows-application - the one that contains the
crystalreport-derived user control - (NOT THE classlibrary itself!)
contained some illegal references. In my case, I referenced the microsoft
internet control classes (axshdocvw, etc.) in a wrong way. To check if that
is the same matter at your code, create a new winapp-project and add the
crystal-control from the classlibrary. It should work.

Hope that helped!
AddThis Social Bookmark Button