Hi WATYF

I had the same problem and it nearly drove me mad.  Then I worked out that
in the form that contains the Crystal report Object, you need to add the
Dataset to your form.  Then you need to:
// fill the data set for the table: 
da.Fill(ds, "TableName"); // where ds is the dataset
//Create a new Datatable (call it whatever you want):  
DataTable dt = ds.Tables["TableName"];
//Assign this table to the SetDataSource of the Crystal Report.
this.crMyCrystalReport.SetDataSource(dt);

Hope this helps a bit.

I may not have explained it well, but I am still learning a lot myself and
just a newbie.  But I do spend hours on Google.

Others may be able to explain this much better.

By the way I don't use the existing data set but do my own SQL Query into a
local dataset for this report.  This way it is easier to do programmatic
filtering and sorting based on criteria that the user specifies before they
call the report.  I am sure that there is a much better way of doing it all.

Maybe other more knowledgeable here can give you a better explanation and
example

Cheers

John  (Sorry too busy to have a fancy Nickname)


-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of WATYF
Sent: Thursday, 9 October 2008 5:20 AM
To: DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web
Services,.NET Remoting
Subject: [DotNetDevelopment] Can't get a simple Crystal Report to return
data...


Hi there. I'm trying to dive in to Crystal Reports for VS 2005 for the
first time but I can't even get a basic sample report to display data.

Here's what I've done.

Created a new Crystal Report. Selected "As A Blank Report" in the
wizard. Right clicked on "Database Fields" and hit "Database Expert".
Under Project Data > ADO.NET DataSets I selected the DataSet>Table
that I want to connect to and hit OK. I could then see MyTable in the
Database Fields tree. So, I expanded the MyTable node and dragged a
couple fields into the "Details" area of the crystal report.

Then I created a basic form and Crystal Report Viewer to test out the
sample report I made, but after running the app and opening the form,
the report shows no data. Just the headers.

What am I doing wrong?

P.S. I know there's data in the table and that the connection to the
db works, because my other forms use the same dataset/table to bind
textboxes, and that's working just fine.

WATYF



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web 
Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/DotNetDevelopment

You may subscribe to group Feeds using a RSS Feed Reader to stay upto date 
using following url  

<a href="http://feeds.feedburner.com/DotNetDevelopment";> 
http://feeds.feedburner.com/DotNetDevelopment</a>
-~----------~----~----~----~------~----~------~--~---

Reply via email to