As we get into some of the more subtle ways to use grouping in Crystal Reports, we sometimes find that either groups of groups, or arranging groups in a hierarchy, can improve the usefulness of the report. One of the overarching keys to a good report is that it be organized so as to make it easier to understand, and therefore more useful. This is even more important given the size of the batches of data we work with now.
A good example would be customer sales “levels”—gold, silver, etc. based on how much a customer spent with a company.
We can start by creating a report with the necessary data, in this case the company name, country, and sales amount. (In a real-world situation, one would include whatever data the grouping should be based on.)
Then, we can insert a group (Insert–>Group), but we use the In Specified Order capability to create arbitrary-but-logical groups based on (in this case) sales amounts. This is where we can customize the grouping using any reasonable criterion we want. The example here is sales levels, but any data from the database can be used. It can even be categories of items sold rather than quantities, just so long as there’s some way to tell one group from the other.
We set up names for the groups using the Named Group box, and limits (in this case monetary) in the Define Named Group box which pops up for the purpose.
We also need to make sure we set up a space for the customers which don’t fall into one of the three “main” groups. (“Occasional”, “Other”, etc., are fine.)
Once we rearrange the labeling a little for convenience, and maybe sort the customers by name, we’ve got a decent grouping set up. One thing to consider about this (and many other kinds of business documents) is to try and have a good idea of the final layout or structure in advance, if possible. It’s a lot easier if you know where you’re going, and you have a decent map.