Generating a Simple Crystal Report using VS 2005 - Selecting the Data
(Page 5 of 7 )
When you click on the Finish button in the above screen, you enter the next step of the report creation wizard. You will be choosing the source of the data on the server you logged on. Here the Northwind database will be used. You may access any of the objects; that includes some of the system objects as well.

Selecting a table(s) from the database
We will be using one of the tables on this database, in particular, the Employees table. Expand the Table node, highlight the Employees table, and click on the button marked ">". This will take the Employees table to the Selected Tables: area as shown. Instead of a single table, multiple tables can also be used.

Selecting Columns (Fields) from the table
A table can have a large number of columns, also called Fields. In a report, depending on the requirement, one may or may not need all the columns. In this case, out of all the available fields only a subset is chosen to be displayed. Transfer all these fields to be displayed from left pane to right pane by clicking one-by-one, or highlighting them as a bunch and using the ">" button. By using the Up/Down arrows in the Fields to Display pane, they can be reordered top to bottom.

Grouping the data
When you click on the Next button, you will be taken to the Grouping area. The Employees may come from different cities and in this case they can be grouped on the basis of the city they come from. In this screen you would choose the Employees. City and click on the ">" button to transfer it to the Group By: column. In the background, the wizard is creating an appropriate SQL Select statement.

Summarizing the data
When you click on the Next button, you will bring up the window shown where you may summarize the data. The data fields we have chosen do not require summarizing, therefore you go the next task by clicking the Next button on the following screen.

Selecting only required fields
Although this section is optional you may still want to make a change to the record selection. For example FirstName was not chosen in the initial selection, but here it was added.

Next: Choosing a Style for the Report >>
More .NET Articles
More By Jayaram Krishnaswamy