Data Connectivity
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Data Connectivity
Message Icon Topic: Custom Class as DataSource Post Reply Post New Topic
Author Message
wortho
Newbie
Newbie
Avatar

Joined: 16 May 2007
Location: New Zealand
Online Status: Offline
Posts: 2
Quote wortho Replybullet Topic: Custom Class as DataSource
    Posted: 16 May 2007 at 3:21am
I am sure this is terribly simple, which is probably why its so frustrating that I cant solve it.
 
What I have is a class library that provides my data, so instead of binding to a database, I can select .Net Data Provider (.dll) and bind to that class.
 
So I have basic properties like Firstname, Lastname exposed of the travellers object. Cool. I can drop these on the Crystal Report (using CR10 for VS2005).
 
Now some magic happens on the inside that populates these so I dont need to care about the actual database connection (for instance I have hard coded values in a proxy object at the moment for proof of concept).
 
However, when I run this ASP.NET application I get a page telling me to log in!
The message is;
"The report you requested requires further information."
And then there is a logon box for the database name, username and password and checkbox for integrated security.
I have tried setting the report to use different ConnectionInfoType (ie; MetaData) but am all out of ideas.
 
Any clues out there really appreciated.
 
Cheers,
Steve
IP IP Logged
wortho
Newbie
Newbie
Avatar

Joined: 16 May 2007
Location: New Zealand
Online Status: Offline
Posts: 2
Quote wortho Replybullet Posted: 16 May 2007 at 3:20pm
Found the answer!
 
My custom class needed to implement IEnumerable interface!
 
So quite simply I just made a generic list of my class.
 
For instance;
 
List<Traveler> _travelerList = new List<Traveler>();
_travelerList.Add(...
 
Then report.SetDataSource(_travelerList)
 
So the database connection error kind of threw me off the scent that the underlying type was wrong.
 
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 16 May 2007 at 6:42pm
Thanks for the update. I'm about a month away for digging into Crystal Reports .NET 2005 to update my 2003 book. It's good to know that it's as easy as they advertise it to be. 
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
billev
Newbie
Newbie
Avatar

Joined: 19 May 2007
Location: United States
Online Status: Offline
Posts: 9
Quote billev Replybullet Posted: 20 May 2007 at 8:04am
Brian,
Tell me about your update to CR 2005.  Will it be a new book or an update to your existing 2003 book.  I have only used the versions of Crystal Reports that come with Visual Studio 2003 and 2005.  I would be using another reporting source if it weren't for your book.  I am anxious to see your "update" to VS 2005.
 
Thanks,
 
Bill V.
Thanks,

Bill V
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.015 seconds.