Crystal report preview no group saction

I've been struggling with this all day now. This is supposed to be so simple. Create a datasource, create a report object, connect the two, move some fields onto the report detail, and the report should display something.

This is in VS 2005 IDE

Here's what happens: I can create a data source and connect to it. I can preview the data successfully (In the data Sources window right-click on the table and select Preview Data. ).

But, when I look at the report object that I have attached to a CrystalReportViewer control, and run the report, I get headings and that's it.

In the Crystal Report object, if I click on "Main Report Preview", I get data but it definitely isn't from my database table. I get colors, days of the week, data types.

What am I doing wrong? Thanks in advance,

How are you viewing the report in the viewer? In other words, is the viewer in its own window or is it part of the window where the data is generated? Have you assigned the viewer's report source to this particular report at design time or are you setting it at run time?

Proviti, Data & Analytics Practice
www.protiviti.com/US-en/data-management-advanced-analytics

the viewer is a control on my main form. Its report Source is the Crystal Report I created. That assignment is done at design time.

Depending on how I view the data will determine the type of output I get:

1. While in the design of the Crystal Report, if I click on the "Main Report Preview" tab, I get data but it definitely isn't from my database table. I get crazy text like colors, days of the week, data types.

2. If I build and run the app, the report I get contains the headings and nothing else. The Preview in Crystal doesn't actually connect to real data - it's dummy data.

Instead of setting everything at design time, try something like this (code is in C# - modify appropriately if you're using VB):

//create a new named instance of the reportMyReport rpt = new(MyReport);
//Set the DataSource of the report to the DataSet defined in your app//NOTE: This is NOT the table - it's the whole DataSetrpt.SetDataSource(MyDataSet);
//Set the ReportSource of the viewer to the report object that you created above.CrystalRptViewer.ReportSource = rpt;
Proviti, Data & Analytics Practice
www.protiviti.com/US-en/data-management-advanced-analytics I can try that tomorrow.

Tell me, though, is doing this going to explain why previewing in the Report designed doesn't provide the data from my DB?

When you preview a report that is connected to a .NET DataSet, the DataSet doesn't really have any data in it. So, Crystal can get the table structures, but it uses dummy data for the preview display.

Proviti, Data & Analytics Practice
www.protiviti.com/US-en/data-management-advanced-analytics

So you can't preview a report in the designer, then? How do you know that it is right before you try to implement it?

Even if I shouldn't come to any conclusions with the preview, I still have the problem that the report, when run, doesn't show any data, either. just headings.

Finally, in other CR designers that I've used, there is always been a data entry screen where you entered the SQL select statement that the report is to be based on. There doesn't seem to be that kind of dagta entry screen in VS2005.

Is it hidden behind some other menu option?

As a PS to my last reply, what if the report data was based on a compound select statement with several tables joined together? There has to be a way to enter that type of SQL query.

If you're basing your report on table in an in-memory DataSet, you have to select the tables in the DataSet and visually join them in the Database Explorer in the report. Crystal will then build the SQL based on the DataSet. At design time, these tables don't have any data in them and your application will have to run the queries that fill the tables in the DataSet prior to running the report.

If you want to connect your report directly to the database, you can use the "Add Command" functionality in the Database Explorer if Crystal allows commands for the type of database you're using.