• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 1. Creating and Designing Basic ... > Creating a Report Without Wizards

Creating a Report Without Wizards

As with many software tools, educational tools and facilitators like the Report Wizards are often the best way to begin a learning process. They are by their nature, however, limited in functionality and it generally does not take long before maturing students want to roll up their sleeves and discover the raw power and incredible flexibility that lies beneath. This section reintroduces the report just created in the Report Wizard through a manual design process in the Crystal Reports Designer. The beginnings of that same Sales Report are created from scratch with the following steps:

Select a report template. After opening Crystal Reports, either click on the New button or access the New option from the File menu. Once in the Crystal Reports Gallery dialog, select As a Blank Report and click OK.

Select an appropriate data source. From the Database Expert dialog that comes up, in the Available Data-sources list, browse to Create New Connection, ODBC. As soon as you choose ODBC, the ODBC (RDO) dialog pops up. Scroll until you find the Xtreme Sample Database 10. Select it and click Finish. (There are no other settings to get this database working, so you can ignore the Next button.)

Select the appropriate tables. After choosing the appropriate database to connect to, you need to select the tables for this report. Move down in the left list box and expand the Tables item. Choose the Customer and Orders tables by using the right-arrow (>) button, shown in Figure 1.27.

Figure 1.27. The Data tab from the Database Expert dialog shows the two tables you just added to the report.


Remember that you can choose each table separately and click the arrow button or hold down the Ctrl key to select all tables that you want and then press the arrow button only once. Also, if you want to select several tables in a row, the Shift key helps you with that.

Link tables from the database. Move to the next tab in the Database Expert dialog by either clicking the OK button or selecting the Links tab. Notice that all the tables have already been linked. Crystal Reports attempts to link tables using similar field names and sizes whenever possible.


You can enlarge this dialog by using the stretch markers so that you can increase the display area and see more tables at once. The next time you enter this dialog, your adjusted size will be remembered.

You don't need to make any changes at this point, so just click the OK button.

Add detail records to the report. First, confirm that the Field Explorer is being displayed so that you can use it to add the fields to the report. If it is not, choose View, Field Explorer. In the Field Explorer that becomes available, open the Database Fields item and then the Orders item to expose the fields that you'd like to add. Select each field separately and drag it to the Design tab using your mouse. Place them side-by-side in the Details Section: Customer Name and Customer City from the Customer table, and Order Amount and Order Date from the Orders table. Figure 1.28 highlights the desired result.

Figure 1.28. This is the Design window after you've added all the fields.

Create a logical grouping of data by Country. To accomplish this, choose Insert, Group. When the Insert Group dialog appears, scroll down the first list box until Country under the Customer table is available. Select it, as shown in Figure 1.29, and then click OK.

Figure 1.29. The Common tab of the Insert Group dialog with the Customer Name field selected.

Notice that in the Design view of the report, two new sections become available called Group Header #1 and Group Footer #1. Within Group Header #1, the Group Name #1 field is also automatically added.

Add a summary value of total Historical Order Amount by Country to the report. Choose Insert, Summary to get the Insert Summary dialog to appear. In this dialog, select the Order Amount field in the Field to Summarize drop-down box. Next, because you plan on finding out how much has been ordered in each country, you need to set the summary operation in the second list box to Sum. Last, because the desired summary is per Country, set the location of the summary to show Group #1, as shown in Figure 1.30. Click OK.

Figure 1.30. The Insert Summary dialog with Order Amount summed by Customer Name selected.


A shortcut to the Insert Summary command (and running total command described later) is accessible for each field on the report by right-clicking the involved field in the report designer.

Notice that in the Design view, in the Group Footer #1, the Sum of Order Amount field has been added.

View the report. Take a look at the report by choosing Report, Refresh Report Data or by either pressing the F5 key or clicking the lightning icon refresh/preview button in your Crystal Reports Designer. A report with all the data represented in the last wizard-driven report you created is returned in the Preview tab as shown in Figure 1.31.

Figure 1.31. The resulting report based on steps 1 through 8 in the Preview tab.

Save the report. Choosing File, Save opens the Save dialog. Provide a suitable name for the report, such as Chap1Manual.rpt. You are welcome to explore the charting and report template features now to replicate the Chap1Wizard report but they are covered in detail in Chapter 8, “Visualizing Your Data with Charts and Maps,” and Chapter 14, “Designing Effective Report Templates.”



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint