Crystal Reports in the Real World—Group on a Formula

Sometimes when creating a report, the development database might not be complete or might be in production; there might be a requirement to group elements based on some criteria that is not in the database. In these cases, it can be useful to group on a formula. The formula needs to meet some criteria that will be explained in greater detail in later chapters.

Open the sample report from Chapter 1 (Chap1Manual.rpt). Create a new formula and name it Group1 and click the Use Editor button.
Type the following text into the code window so it appears like Figure 2.21:
 WhileReadingRecords; Select {Customer.Country} Case "Canada", "Mexico", "USA": "North America" Default: "Outside North America"; ...

Get Special Edition Using® Crystal Reports® 10 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.