Data Connectivity
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Data Connectivity
Message Icon Topic: How to use DataReader in Crystal Report Post Reply Post New Topic
Author Message
gaurish
Newbie
Newbie
Avatar

Joined: 21 Mar 2008
Location: United Kingdom
Online Status: Offline
Posts: 2
Quote gaurish Replybullet Topic: How to use DataReader in Crystal Report
    Posted: 21 Mar 2008 at 8:23am
Hi,
I use datareader to retrive data from database , I tried a lot to generate crystal report useing datareader but i failed ..
Can any one help me or can show me how to use datareader in crystal report ..
I would be really happy , if any one can help me .. Please .. Its urgent ..
Regards
I am using access database (.mdb) and VB.net
Gaurish Ray
 
 


Edited by gaurish - 21 Mar 2008 at 8:24am
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 21 Mar 2008 at 2:35pm
Are you using VB.NET 2005? I ask b/c you can't do this with VB.NET 2003.

It's a bit complicated, and I explain it in more detail and give sample code in my online  Crystal Reports eBooks (you should check them out for a lot more info on using .NET with CR).

The way it works is that CR needs to know how the datareader's data is structured. The only way it can do this is by calling the datareader and examining it's data. So you have to put the datareader in its own DLL and return it using a Shared method (static in C#) of the IDataReader interface. Then when you design a new report, you can point the data source to this DLL and CR will instantiate the DLL, call the Shared method and determine the data structure to report from. When you run the report, it also uses this DLL to get the data to display on the report.

Once you get the report designed, in your project you need to instantiate the DLL in your code and send assign the datareader shared method to the SetDataSource method of the ReportDocument object.

I hope this helps.

You can find out more about my books at Amazon.com or reading the Crystal Reports eBooks online.


Edited by BrianBischof - 21 Mar 2008 at 2:35pm
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
gaurish
Newbie
Newbie
Avatar

Joined: 21 Mar 2008
Location: United Kingdom
Online Status: Offline
Posts: 2
Quote gaurish Replybullet Posted: 22 Mar 2008 at 6:29am
Many thanks for your reply.. Now I am looking at the web site u told to look at. Is there any chance to provide some code example .. I would be really greatful , If u kind enopugn to provide me code example..
 
many thanks again ..
regards
Gaurish
 
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.016 seconds.