Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Call C# class from Crystal Report Post Reply Post New Topic
Author Message
holzert
Newbie
Newbie


Joined: 24 Aug 2008
Online Status: Offline
Posts: 3
Quote holzert Replybullet Topic: Call C# class from Crystal Report
    Posted: 24 Aug 2008 at 2:20pm

Can I create a utility class in C# VS2008 and call it from the report? 

We have some reports that currently call a common function in a prg in VFP.  We are rewriting in C# and using Crystal Reports.  We would like to change that to a VS2008  class called from many Crystal reports…

Is this possible?  If so, does the class have to exist in the same assembly?

IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 09 Sep 2008 at 4:14pm
I haven't tried this, but I found this link
 
 
using a Google search on crystal report user function library C#.
 
-Dell
IP IP Logged
holzert
Newbie
Newbie


Joined: 24 Aug 2008
Online Status: Offline
Posts: 3
Quote holzert Replybullet Posted: 09 Sep 2008 at 4:39pm
Thanks.  I should have posted earlier.  I had found that as well but I disregarded it because I found it that the classes are only available via com interop...
 
Thanks!  It will be nice to have that available for lurkers...
 
Tch
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 10 Sep 2008 at 6:59am
Yeah...COM....yuck.  However, ALL of the Crystal and BusinessObjects .NET classes are just wrappers for the underlying COM classes.  So, even when you're not building a UFL, if you're using Crystal, you're using COM. 
 
FYI, because .NET is not very good at garbage collecting with COM objects, you need to be sure to either wrap your calls to the Crystal classes in "Using" clauses or explicitly call .Dispose() on the object when you're finished with it.
 
-Dell
IP IP Logged
holzert
Newbie
Newbie


Joined: 24 Aug 2008
Online Status: Offline
Posts: 3
Quote holzert Replybullet Posted: 10 Sep 2008 at 9:42am

Thanks!

IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.