Data Connectivity
 Crystal Reports Forum : Crystal Reports .NET 2003 : Data Connectivity
Message Icon Topic: Creating Crystal Reports using Datasets Post Reply Post New Topic
Author Message
farid_nasiri
Newbie
Newbie


Joined: 14 Nov 2006
Online Status: Offline
Posts: 5
Quote farid_nasiri Replybullet Topic: Creating Crystal Reports using Datasets
    Posted: 14 Nov 2006 at 11:07pm
I will start from the scratch.

1. First you have to create a XML dataset file which can be done by right
clicking on your project (Solution Explorer) Add - Add New Item then choose
Dataset. Design your dataset which is pretty straight forward.

2. Now design the report using the Dataset you have created above which can
be done by right clicking on your project (Solution Explorer) Add - Add New
Item then choose Crystal Reports this time. You will be prompted for the
data instead of using the normal way (ie tables) choose Project Data then
choose ADO.NET Datasets. Now select the one you have created in Step 1 and
start designing your report based on that dataset.

3. Now coming to your coding...

Instead of using the standard Dataset. Create a new instance of the Dataset
that you have created in Step 1

Dim ds as New MyDataset() 'The dataset that you have created in XML

4. Fill this Dataset with data as you do for anyother Dataset.

5. Create a new instance of the Crystal report.

Dim report as New MyReport()

6. Now do the binding

 reporpt.SetDataSource(ds)
 ReportViewer.ReportSource = report

Basically once you understand the flow it's very straight forward creating
Reports using Datasets.
IP IP Logged
raiyan
Newbie
Newbie
Avatar

Joined: 11 Jan 2007
Online Status: Offline
Posts: 6
Quote raiyan Replybullet Posted: 11 Jan 2007 at 9:27pm

farid_nasiri,

Thanks for a good post.
 
I did exactly as you said , now whenever I run the program , it asks for server name , database name , password etc. i know what the database name, user id and password is. i am not sure what should be the server, can you help me ? is it the same as the database name ? I have used oracle data adapter for fectching the data from backend.
:)
IP IP Logged
raiyan
Newbie
Newbie
Avatar

Joined: 11 Jan 2007
Online Status: Offline
Posts: 6
Quote raiyan Replybullet Posted: 11 Jan 2007 at 11:56pm
hey, i've solved it myself !
 
The thing is , I have to connect with the database first , then fill dataset , then bind. Initializing the reports from designer does not work in this case.
:)
IP IP Logged
lovesirius12
Newbie
Newbie


Joined: 18 Apr 2007
Location: Philippines
Online Status: Offline
Posts: 3
Quote lovesirius12 Replybullet Posted: 18 Apr 2007 at 1:06am
hi. i did created a dataset and put three tables in it. i set it as the data source for my crystal report form.

but when i run it, there was an error and said that the report does not have tables. i dont understand.

please help! thanks.
IP IP Logged
raiyan
Newbie
Newbie
Avatar

Joined: 11 Jan 2007
Online Status: Offline
Posts: 6
Quote raiyan Replybullet Posted: 18 Apr 2007 at 6:48am

Did you use the dataset builder in .net to build you dataset ? The tables(schema) in dataset must match exactly with the tables(schema) in your database. Make sure that first. Then create an instance of that dataset class in you project.

When you program starts, connect to the databse.
 
After connecting, you can use a data adapter to fill the dataset.
 
Dont forget to set the dataset as datasource for the report.
 
You'll find the things mentioned above in many other places, but these are  common sources of error. So make sure you've done these things right.
 
One more thing. If you find it difficult to make the dataset exactly like the schema in your database, you can try untyped dataset.


Edited by raiyan - 18 Apr 2007 at 6:49am
:)
IP IP Logged
lovesirius12
Newbie
Newbie


Joined: 18 Apr 2007
Location: Philippines
Online Status: Offline
Posts: 3
Quote lovesirius12 Replybullet Posted: 19 Apr 2007 at 6:27pm
hi. thanks raiyan.


Edited by lovesirius12 - 19 Apr 2007 at 6:38pm
IP IP Logged
SriramRamani
Newbie
Newbie
Avatar

Joined: 29 Oct 2009
Location: India
Online Status: Offline
Posts: 3
Quote SriramRamani Replybullet Posted: 29 Oct 2009 at 5:37am
Hi there,

     Here is my situation. I have created a window based application with Access as the database there are 7 tables in it. I have created a deployment project in which i have included all the files (.exe .mdb). Now when i install the application in the client's m/c this database and the exe files gets copied to somewhere as per thee user's wish during install(installing location).. Let us consider the file has (i mean the dbs file , the mdb file)been copied to c:\application. when i print a report in the application it has to fetch the dbs directly from this location.

i did created a dataset and put a tables in it. i set it as the data source for my crystal report form.
but when i run it, there was an error and said that the report does not have tables. i dont understand.

please help! thanks.
Very urgent please
Sriram
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.047 seconds.