Set Up Your Database and Create a Report in Crystal Reports
Learn How to Create a Report and Print it in Crystal Reports 2008
Crystal Reports 2008 is a popular database reporting tool, and for good reason. This powerful and dynamic tool allows you to design, explore visualize and deliver reports. They can be viewed on the web or embedded in enterprise applications, and printing Crystal Reports is a breeze.
When it comes to Crystal Reports setup, the user is given several options, such designing a report from scratch using a blank report, or using one of several wizards like standard report wizard, cross-tab report wizard, mailing label report wizard, or OLAP-cube reports wizard to create a report. Below mentioned are the some of the points one should consider before deciding how to create a report in Crystal Reports.
- which tables in the database contain the data we want.
- which data items we want from those tables.
- what manipulations of the data to perform to give the information we want.
- how we want our report to be formatted.
Below you will find the step by step procedure for creating a report using the blank report option in Crystal Reports 2008:
Open the Crystal Reports 2008 Designer from Start->All Programs->Crystal Reports 2008.
The Crystal Reports start page appears as shown below.
Select the File->New->Blank Report option. The database export dialogue box appears, which shows us all of the possible places we might find our data source.
In the Available Data Sources pane, click the plus sign to the left of the create new connection folder to expand it and select the database type.
Select the required database type by double clicking on it; then the connection details window appears. (In this example Access/Excel (DAO) data type is selected.)
Click the ellipsis button to the right of the database name field. This will allow you to choose the database file that you have previously set up. In this example we will be using the test data ‘xtreme’.
Select the database file and open it. Then click the Finish button from the access/excel (DAO) window. If the connection is successful the database expert window reappears as shown below. This displays connection, Add Command, Tables, Views, and Stored Procedures.
Create Your Report
Now that you have set up your database, you are ready to create your report in Crystal Reports 2008. Now expand the Tables node and then double click the tables on which report should be created.
When you have selected your tables, click OK. A new window will appear, which shows the relationship between tables by keys. If the connection is not correct, create the appropriate links by dragging fields from one table to corresponding fields in another table.
By default, Crystal Reports 2008 joins the table using inner join. If the join type and other linking options needs to be changed, click on link and the click on Link Options button.
Click OK to close database expert window. Then the blank report fills the window with design tab on the left hand side and field explorer on the right hand side of the window.
The design tab displays five sections of the report:
- Report Header: Appears only at the top of the report and is the ideal place to tell the reader exactly what the report contains.
- Page Header: Appears below the report header and at the top of all other pages in the report.
- Details: The actual content of the report.
- Report Footer: Appears after the last detailed information in the report.
- Page Footer: Appears at the bottom of every page of the report.
In Field Explorer, click the plus sign to the left of Database Fields. Then click the plus sign to the left of tables to display its fields.
Click the first field that needs to be included in the report, and then drag it to the left edge of the details section. Repeat this step for all the fields that need to be included in the report.
To print your report, first switch to preview mode by clicking the print preview icon on the standard toolbar. This displays the preview tab in the upper-left corner of the work area. Here you have the complete report including the data from the Employee and Employee_address table.
Headers and footers can also be added to Crystal Reports through the design tab, where you will also find an option to change the size and name of columns using the toolbars at the top of window.
And there you have set up your database and created a Crystal Report with the option to print