Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


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

Chapter 1. Integrating Crystal Reports i... > Sorting, Grouping, and Subtotaling

1.3. Sorting, Grouping, and Subtotaling

So now we have a report with a header, footer, and a list of last names. Well, I don't think that is going to get us very far with our boss. Let's add a few more columns to the report to make it more meaningful. Expand the Database Fields node in the Field Explorer. Expand the Contact table and drag the FirstName and EmailAddress fields into the Details section of the report. Click on the "Main Report Preview" button and notice that there are approximately 313 pages in the report, depending on how large you made the sections. Click back to the Main Report view. Expand the Employee table in the Field Explorer and drag the NationalIDNumber field to the Details section of the report. Now click on the "Main Report Preview" button again. Now there are only five pages. This is because employees are not the only people stored in the Contact table; customers are too. Since a field wasn't used on the report from the Employee table, Crystal ignored the join and brought all the records from the Contact table. If you open SQL Query Profiler and view the executed SQL statement when the NationalIDNumber is not in the report, it looks like this:

SELECT "Contact"."LastName", "Contact"."FirstName", "Contact"."EmailAddress" FROM "
AdventureWorks"."Person"."Contact" "Contact" ORDER BY "Contact"."LastName"

					  


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint