Question My Report Isn't Displaying Any Records from DB - What am I doing wrong?

kismetgerald

New member
Joined
Jan 13, 2013
Messages
4
Programming Experience
Beginner
Good-day All,

After watching numerous online tutorials and reading the documentation, I decided to get hands on with the Crystal Reports for Visual Studio runtime. It is my understanding that the SAP Crystal Reports runtime doesn't natively support connections to a MySQL DB so I believe I've done everything correctly to pull the DB records into a Dataset object. I can see the records in the Dataset and they match what's in the Database. Unfortunately, when I run a preview of the report everything is "gibberish" except for the Date fields. Also, at run-time the report is blank.

I'm stumped and don't know what to do now, any assistance would be greatly appreciated. Screenshots below show the records from the Dataset as well as the Report preview.

  1. Screenshot #1: VIEW OF DATASET RECORDS
  2. Screenshot #2: DESIGN VIEW OF REPORT
  3. Screenshot #3: PREVIEW OF REPORT

By the way, the Collation on the server and table are both set to "Latin1 - Default Collation" - not sure if that makes any difference.

Thanks.

//Kismet
 
No Ian, unfortunately that doesn't help. In fact, that was one of the first posts I read. My problem isn't with report not being refreshed - mine is that the initial data I retrieved from the DB is showing up as random text (eg., the row IDs are showing as random whole numbers, the username column is showing days of the week, etc). The only column showing up correctly is anything with a Date format (or should I say, a Date datatype). Then at run-time, when I debug, i get a blank report.

It's almost as-if the data in the Dataset can't be understood by the CrystalReportsViewer control.
 
Hi,

In my experience you will find that the previous post will fix the blank report when it's ran since it gets the data from your source first and then applies that to the CR. As to the random text at design time, I have always got that myself and have just lived with it. I put this down to CR just giving example text so that you can design the structure of your report as you need to.

Hope that helps.

Cheers,

Ian
 
It worked, thanks. I didn't realize that the DataSet I created using the Server Connection in Visual Studio was just so I can have access to the columns/fields to create the report. It's in fact necessary to query the database again at run-time and create a new dataset which will be assigned to an instanciated copy of the pre-designed report as its datasource.

Thanks to you I am now armed with new information. I really appreciate it.
 
Back
Top