Crystal Reports version 9 includes significant cross-tab improvements in that they are even more customizable and easy to work with. The advanced features give cross-tabs improved flexibility and functionality to satisfy even more reporting requirements. We'll continue to improve the Xtreme Mountain Bikes report (crosstab2.rpt) that we've already started to further demonstrate these new features. Relative PositionWhen it comes to planning the width or length of cross-tabs, they can be thought of as an accordion. With the addition of new information or data, the number of rows or columns can grow or shrink. This makes putting objects at the end of a cross-tab very difficult because it's unclear when the object will be overwritten (if new data comes along). The bottom of a cross-tab has an easy solution. Just put the new object in the next report section even if it means adding a new section. By default, objects in Crystal Reports will not overwrite a section, so the solution is a simple one. However, the columnar situation (number of columns) is another problem altogether. In the Xtreme report, management wants the Xtreme logo to be displayed to the right of the cross-tab. But, in Design, the size of the cross-tab doesn't match what we see in Preview. We will need to use a section format property called Relative Position to get the image in the desired place. Let's work through an example to see the result:
The Relative Position property works on the left, top, and right borders of the cross-tab. Remember that the bottom border of the cross-tab is handled by the end of a section. Relative Positions can be used in many situations. For example, showing a chart on the information in the cross-tab can be very useful. Percentage of SummarySummary values can also be displayed as percentages of either the total rows or total columns. Let's assume that the management at Xtreme needs this in their report as well. Let's continue on with our report:
Notice that the USA is consistently the largest percentage of Xtreme's orders. It's very easy to see this when percentages are added to the cross-tab. Of course, the look of the cross-tab is not yet ideal. More advanced formatting will help in this matter. Horizontal and Vertical PlacementBecause the percentages add up to 100% down the page, it would be easier to understand if the summaries could be displayed side by side instead of one on top of the other. That way, the numbers down the page could be added up easily. Crystal Reports allows the toggle between horizontal and vertical placement of summaries, so let's make this update to the Xtreme report.
Summary LabelsNotice that on the report in Figure 14.10, both titles for the percentage and the summary are exactly the same (Order Amount). This is because Crystal Reports is showing the field that a summary is acting on. In this case, where the field is being acted on twice, it's not a good choice. Crystal Reports allows you to edit these labels right on the cross-tab in both Design and Preview modes.
The formatting of this cross-tab is coming along, and Xtreme is very happy with its progress. There is one more requirement before the report can be submitted as complete. Adding a Display StringCross-tabs are based on the need for numbers or currency to be summarized, but there are times when the numbers don't need to be seen to get the point across. Instead of seeing the numbers, why not show something more inventive? Crystal Reports has a feature for all fields called Display String. This formatting feature allows a different representation for a field than its underlying value. For example, what if a teacher wanted to see a grade letter beside a percentage mark, as shown in Figure 14.12? Figure 14.12. Math 101 marks with letter grades as display strings.As previously mentioned, cross-tab cells are always an intersection of rows and columns with a summary because the strings are the visual representation of the underlying summary being computed in the cross-tab. We can affect this string using the advanced Cross-Tab features of Crystal Reports. Crystal Reports can now separate the data value from its display. This is a powerful feature and is not limited to cross-tabs; although it plays a major role in cross-tabs because of the requirement of summaries. To complete this report, Xtreme's management team requires that all $0.00 amounts be shown as NONE on the report.
|