Crystal Reports Online Training

Learn Online, Anytime, Anywhere

Step-by-step online tutorials.

13.05 Placing the Cross-Tab Object

Placing the Cross-Tab Object

If you look back at the cross-tab report example in Figure 13-2, you might notice that the cross-tab object as it appears in the report designer doesn’t look like the cross-tab grid as it appears when printed on the report. This is because the report designer shows the cross-tab object as being a template for showing you what fields are used and how the cross-tab grid will be formatted. When the report is run, the cross-tab object expands vertically and horizontally so that it can print as many columns and rows as necessary to show each group. If you expect your report to have a lot of columns, it’s best to place it close to the left side of the report to account for all the columns.

Be careful when placing data fields (or any report object) after the cross-tab object. When a cross-tab object prints in a section, it grows as large as necessary to show all the data. If you place other report objects below the cross-tab component, in most cases the cross-tab will expand to overwrite those objects. To fix this, create a second section in that same area and place the data that comes after the cross-tab in the new section. Sections never overlap each other and this ensures that the data in the new section always prints after the cross-tab.

The cross-tab object can only be placed in certain sections: the Report Header/Footer and the Group Header/Footer. It can’t be placed in the detail section because it can’t print detail records. It also can’t be placed in the Page Header because it would be duplicated on each page without any of its data changing. This would create redundant information that wastes space.

Be careful about where you put the cross-tab object. It prints out whatever information is available to it. Placing the cross-tab in the Report Header/Footer produces different results than putting it in the Group Header/Footer. When placed in the Report Header, it has access to every record in your report. It summarizes all the data in the report and could be quite large. When placed in the Group Header, it only has access to the data for that group. The cross-tab will be much smaller because it only prints a subset of all the report data.