Operation Manual
Contents
Crystal Reports User’s Guide 7
Record selection performance tips . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Strategies for writing efficient record selection formulas . . . . . . . . . . 146
Incorporating parameter fields into record selection formulas . . . . . 148
Using SQL expressions where appropriate . . . . . . . . . . . . . . . . . . . . 150
Improving grouping, sorting, and totaling . . . . . . . . . . . . . . . . . . . . . . . . 151
Performing grouping on server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Benefits of grouping on server—an example . . . . . . . . . . . . . . . . . . . 152
Using SQL Expressions for groups, sorts, and totals . . . . . . . . . . . . 153
Using SQL Expressions for Case Logic . . . . . . . . . . . . . . . . . . . . . . . 153
Inserting summary and running total fields where possible . . . . . . . . 154
Chapter 9 Record Selection 155
Selecting records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Using the Select Expert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Using formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Interaction of the Select Expert and the Formula Editor . . . . . . . . . . 159
Using formula templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Record selection formula templates . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Pushing down record selection to the database server . . . . . . . . . . . . . . 162
Troubleshooting record selection formulas . . . . . . . . . . . . . . . . . . . . . . . 163
Correcting selections that do not generate data . . . . . . . . . . . . . . . . 165
Chapter 10 Sorting, Grouping, and Totaling 167
Sorting data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Understanding sort options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Sorting single and multiple fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Grouping data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Creating custom groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
Sorting groups conditionally . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Sorting records within groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Group selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
Grouping data in intervals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Grouping by the first letter of a company name . . . . . . . . . . . . . . . . . 182