Data Connectivity
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Data Connectivity
Message Icon Topic: Report is generated but shows no data Post Reply Post New Topic
Page  of 4 Next >>
Author Message
a9192shark
Newbie
Newbie


Joined: 14 Feb 2007
Location: United Kingdom
Online Status: Offline
Posts: 5
Quote a9192shark Replybullet Topic: Report is generated but shows no data
    Posted: 09 Mar 2007 at 6:31am
Hello,
 
I have developed a windows application in VB (VS2005) that is linked to a SQL Server 2005 database.
 
The application will have lots of different reports so I have created a single form called frmPreviewReport that contains a single viewer.
 
When the form loads it updates the ReportSource of the viewer to be a .rpt file and displays the report.  However there is no data in the report.
 
I have added the line Imports System.Data to the top of the forms class file as instructed on an MSDN page.
 
I have verified the database link.
 
I know that there is data and I am only displaying data from a single table.
 
The data is pulled from a dataset defined in the VS project.
 
Do I have to fill the data set?  I thought CR would do that.
 
Why is my report not showing any data?
 
Another issue, that may be linked, is that I keep getting an error message "Unable to find the report in the manifest resources."
 
Hope you can help me!
 
Thanks,
 
Alan.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 09 Mar 2007 at 12:58pm
Yes, you have to fill the dataset.  When working with data sets instead of direct connections to the tables, Crystal expects the data to already be there.
 
As for the error message, is the report included in the project?
 
-Dell
IP IP Logged
rbblack
Newbie
Newbie
Avatar

Joined: 26 Apr 2007
Location: United States
Online Status: Offline
Posts: 6
Quote rbblack Replybullet Posted: 26 Apr 2007 at 5:57pm
HI, newbie here.  Could you be more specific as to how to fill the dataset?
 
I would greatly appreciate it!
 
Thanks
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 27 Apr 2007 at 6:25am
Your .NET program has to put data into the dataset prior to running the report that reads the dataset.  How this is done is dependent on how you've set up your dataset.  If it's tables, you can just open the tables.  If it's based on a query, you have to run the query.  If the data is generated through code, then you have to generate the data. (For example, I have an app that does a user audit from Business Objects Enterprise XI.  It gets the user information from BO XI through the SDK and saves it to a table in the dataset.  It then reads user information from our security database and updates the table based on that.  Then it opens up the audit report.)
 
-Dell
IP IP Logged
rbblack
Newbie
Newbie
Avatar

Joined: 26 Apr 2007
Location: United States
Online Status: Offline
Posts: 6
Quote rbblack Replybullet Posted: 27 Apr 2007 at 11:34am
Thanks for the reply.
 
OK, so my app is filling the dataset once I choose to save it to database...the report still comes up blank., any other reasons for that?
 
Thanks again
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 30 Apr 2007 at 4:06pm
...once I choose to save it to database...
 
Ok, I'm confused....
 
Does the report read from an in-memory dataset or from the table in the database?  If it's from an in-memory dataset, then saving it to the database makes no sense in this situation.  If you want it to read from the database, then it needs to connect directly to the database, not to a dataset in your application.
 
-Dell


Edited by hilfy - 30 Apr 2007 at 4:07pm
IP IP Logged
rbblack
Newbie
Newbie
Avatar

Joined: 26 Apr 2007
Location: United States
Online Status: Offline
Posts: 6
Quote rbblack Replybullet Posted: 30 Apr 2007 at 7:27pm
well, actually, in this case I would think that it's one and the same, though I'm probably wrong, because I've set up the report to run from within the application, so you can only access the report while the app is running and while the data is displayed in the app. 
 
Let me start from the beginning... My app (a windows desktop app) calls a web service to get the data.  Once it obtains the data the data is displayed in a gridview (on the form that calls the web service, the "search" form) and you can choose which rows to "add to database."  Once the data is added to the database it is displayed on another form with a gridview (the "view" form).  On another form I set up a cr-viewer to connect to the same dataset that the view form is displaying data from.  In this case it's only the "title" field, but if I get this working then in the future there'll be more fields added.
 
I'm probably going about this all wrong, but this is the first report I've ever tried to do and I didn't do any studying beforehand...
 
If it's not a waste of your time to help an amatuer I'd like to hear how you would go about this...
 
Is it possbible to have the report in the same app that fills the dataset, or do I have to create a report app separately?
 
Thanks again!


Edited by rbblack - 30 Apr 2007 at 7:29pm
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 01 May 2007 at 7:08am
You can absolutely have your report in the same app that fills the dataset - that's the way it's supposed to work when you are running off of in-memory datasets. 
 
What does your code do to the dataset after it saves the data to the database?
 
How are you setting the datasource for the report?
 
-Dell
 
IP IP Logged
rbblack
Newbie
Newbie
Avatar

Joined: 26 Apr 2007
Location: United States
Online Status: Offline
Posts: 6
Quote rbblack Replybullet Posted: 02 May 2007 at 3:10pm

After an item is added to the database:

'''All titles in the database are loaded into the in-memory datatable;

''' The (viewer) control monitors for changes to the datatable and auto saves changes made to each field.

I used the Smart Tasks panel to select the datasource/dataset from "Current connections"
I also used the code-based development model in the Crystal Reports for Visual Studio 2005 tutorial with the same results.  I get a beautifully generated report with the "Titles" header and the rest is blank.
 
Thanks again-Rob
IP IP Logged
jabi
Newbie
Newbie


Joined: 08 May 2007
Online Status: Offline
Posts: 1
Quote jabi Replybullet Posted: 08 May 2007 at 1:21pm
Hello:

I exactly have the same trouble, i try show a report but it appears without data, only column's titles appear. I don't know what option i've to choose for a database in Sql Server:


Option i am choosing is ADO.NET and then i select my dataset, but it doesn't work.

I use Visual Studio 2005 and Sql Server 2005 too.

Thanks,

Javi, from Spain.
IP IP Logged
Page  of 4 Next >>
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.