Using the CrossTab object under Advanced Controls in the Next Generation R:BASE Turbo V-8 for Windows Report Designer, you can display calculated values in a multi-dimensional grid format, such as Columns, Rows and Values.

To define a dimension, place CrossTab control on report Detail section and then using the right-click select Configure... menu option. A diagram of the CrossTab definition is then displayed. Here you can specify column dimensions by dragging fields from the field list into the 'New Column' cell. Row and Value dimensions can be created by dragging fields into the 'New Row' and 'New Value' cells. Once your dimensions are defined, you can configure the 'look and feel' of your CrossTab by selecting the dimension in the diagram and then using the formatting controls in the dialog.

When the CrossTab is generated, the row and column dimensions that you define become the captions which appear on the outside edges of the CrossTab grid. The unique field values for each dimension become the caption values. The value dimensions which correlate to the given row and column values are displayed within the grid. If there are no corresponding values for a given column/row pair, a blank is displayed.

The Gridlines property for CrossTab configuration determines whether the lines which border the various information in the CrossTab grid will appear. To set the Gridlines property for CrossTab configuration, click the right mouse button. Selecting the Gridlines option from this menu will toggle its value.


CrossTab Calculations
:

Calculations are performed for the set of records which match the given column and row cell. If there are no column or row dimensions, then calculations are performed for every record in table. Calculation options include

Count:   Count number of records in each set.  
Sum:   Sum column value for each set of records.  
Minimum:Calculate minimum column value each set of records.  
Maximum:Calculate maximum column value for each set of records.  
Average:Calculate average for each set of records.  

By default, CrossTab control calculates the Sum of column value for each set of records. To calculate other options such as Count, Minimum, Maximum or Average, click on "Sum of Columname" cell in configuration menu and then select appropriate calculation option from "Layout" drop-down menu.

Other configuration options include Font, Color, Display Format and Skip Nulls.

The Skip Nulls defaults to True. When retrieving a value for a column, row or value dimension, this property indicates whether the value should be skipped when it is null. Normally when a null or empty value is retrieved for a row or column dimension field, '(blank)' is displayed as the caption in the CrossTab. When a null value is retrieved by a value dimension, it is treated as a zero. Setting Skip Nulls to False will cause the caption or value to be included in the CrossTab.


Additional Properties of CrossTab:


To set the additional properties of CrossTab in Report Designer, position your mouse cursor over the CrossTab control and click the right mouse button. The speed menu will include the following options:


Draw:

Defaults to True. Determines whether the CrossTab will actually be rendered in the report. It is sometimes useful to turn draw off and use the CrossTab control as a way of providing calculations in a report.

Note: Setting Draw to False will keep the CrossTab from rendering. Setting Visible to False will keep the CrossTab from both generating and rendering. Therefore, you will need to make sure that the Visible property is set to True if you intend to use the techniques described above.


Pagination:


This property of CrossTab determines the order in which CrossTabs which do fit on a single page will print. These are the possible values:

Across then Down:Print all of the pages across the top of the matrix, then print the next 'row' of pages, etc., etc until the matrix is completely printed.  

Down then Across:Print all of the pages down the side of the matrix, then print the next 'column' of pages, etc, etc until the matrix is completely printed.  

Grid Color:

Specifies the grid color.


Parent Width:

The Parent Width property of CrossTab determines whether the CrossTab control spans the width the band. You can set this property to false and resize the CrossTab in order to create 'side-by-side' CrossTabs.


Position
(Left, Top, Width, Height, Bottom Offset, Overflow Offset, Stop):

The Left property determines the horizontal coordinate of the left edge of a CrossTab control relative to the left edge of the parent band's starting print position.  

The Top property determines the vertical coordinate of the top left corner of a CrossTab control. The value of top is relative to the value of a CrossTab control's parent band.  

The Width property expresses the horizontal size of a CrossTab in report units.  

The Height property expresses the vertical size of the CrossTab in report units.  

Bottom Offset property is used to define the vertical space that should appear after the CrossTab has printed. The Bottom Offset is expressed in report units.  

Note: The Bottom Offset acts as a margin between the stretching controls and the controls that are shifting or stretching in relation to it.  

Overflow Offset is used to define the vertical space that should be above the CrossTab when it is overflowing onto an additional page. The OverFlow Offset is expressed in report units.  

Note: The OverFlow Offset acts as a margin between the stretching controls and the top of the page.  

Stop Position is used to define the vertical position at which the CrossTab will stop printing. The Stop Position is expressed in report units.  

Note: Together with the Top and OverFlow Offset properties, the Stop Position can be used to restrict CrossTab to a certain position on the page. This is often useful when you are printing on pre-printed forms and need to print information within a certain rectangular area on the page.  


ShiftRelativeTo:


When multiple stretching controls occupy the same band, use this property to specify how each control should be positioned relative to other stretching controls. ShiftRelativeTo can only be used for controls that are dynamically
sized. If you have a static control, such as a label, which needs to shift relative to a given stretching control, then place the control in a region and set the Region's ShiftRelativeTo to the stretching control.

Note: When stretching controls are placed within a region, the ShiftRelativeTo property is disabled. You may notice that all of the stretching controls in the band do not always appear in the ShiftRelativeTo dialog when you are assigning this property. This is due to validation logic which ensures that controls which are shifting relative to one another are not involved in a circular reference. In other words, if Memo is shifting relative to DB Memo, then DB Memo cannot shift relative to Memo, as this would create a situation which the report designer could not resolve. Stretchable controls include Memo, DB Memo, Region, Rich Text and DB Rich Text.


Stretch:


The Stretch property determines whether the Height of the CrossTab automatically stretches to allow the entire contents of the CrossTab to be printed. Defaults to True.

To set the Stretch property from the Report Designer, position your mouse cursor over the CrossTab control and click the right mouse button. If it is checked (the default), the CrossTab will stretch, overflowing to additional
pages if necessary. Selecting the Stretch option from this menu will toggle its value.


Style:


Determines the 'look and feel' of the CrossTab. The are two styles currently provided with the CrossTab control 'Standard' and 'Repeated Captions'. The Repeated Captions style forces the CrossTab to reprint the appropriate row and column captions when a CrossTab does not fit on a single page.


Visible:


The Visible property determines whether the CrossTab control will be printed. Defaults to True.

Note: If Visible is set to False, then the CrossTab grid will not be generated. If you want to hide the CrossTab rendering, but still generate the CrossTab grid, use the Draw property.