TRVCrossTab.Column, FirstRow

<< Click to display table of contents >>

TRVCrossTab.Column, FirstRow

These properties define the location of a cross-tab header in the report table

property FirstRow: Integer;
property Column: Integer;

A cross-tab header consists of cells located in:

rows from FirstRow to FirstRow + Levels.Count - 1

columns from Column to Table.Cells[FirstRow, Column].ColSpan - 1

Structure of a cross-tab header

The cross-tab header has Levels.Count rows.

the FirstRow-th row corresponds to Items[0];

the (FirstRow +1)-th row corresponds to Items[1];

and so on.

The Column-th column is the leftmost column of the cross-tab header. It contains cells corresponding to data columns. Other cross-tab header columns, if they exist, correspond to summary columns.

For every row R in the cross-tab header, except for the first row, Table.Cells[R, Column].ColSpan <= Table.Cells[R - 1, Column].ColSpan. If this is a strict inequality, the right column(s) define headers for summary columns at this level. For the first row, all columns outside the cross-tab columns can be considered as summary columns. Summary header cells can span across columns, but not beyond the cross-tab header's right side.

If the cell in the leftmost column of the last cross-tab level has ColSpan > 1, this means that a group of ColSpan columns is replicated for each cross-tab data.

For every row R in the cross-tab header, Table.Cells[R, Column].RowSpan = 1. Other (summary header) cells may span across rows, but not beyond the cross-tab header's bottom side.

Below you can find some examples. The pink color shows cross-tab header cells corresponding to data columns, the light blue color shows cross-tab header cells corresponding to summary columns.

Example 1

The most simple example, only one item in Levels.

Template

Result Sample

 

{#Person}

{Year}

${Salary}

 

Alice

Bob

Carol

2014

$1000

$2000

$3000

2015

$4000

$5000

$6000

Example 2

One item in Levels, two data columns

Template

Result Sample

 

{#Person}

Salary

Days

{Year}

${Salary}

{WorkDays}

 

Alice

Bob

Carol

 

Salary

Days

Salary

Days

Salary

Days

2014

$1000

100

$2000

200

$3000

300

2015

$4000

300

$5000

300

$6000

300

Example 2

Two items in Levels

Template

Result Sample

 

{#Question}

{#Option}

{Age}

{Percent}%

 

Do you like porridge?

Have you ever seen a mouse?

Yes

No

Yes

Never

Not sure

Below 20

10%

90%

10%

80%

0%

20 and older

50%

50%

10%

0%

80%

Example 3

Two items in Levels, a summary column. Additionally, the rightmost table column is used as a grand summary.

Template

Result Sample

 

{#Category}

Grand Total

{#Product}

Total for {#Category}

{Year}

{Sales}

{sum(Sales)}

{sum(Sales)}

 

Fruits

Vegetables

Grand Total

Apples

Oranges

Total for Fruits

Tomatoes

Cucumbers

Total for Vegetables

2014

100

200

300

300

400

700

1000

2015

150

250

400

350

450

800

1200

Example 3

Three items in Levels, two summary columns in each level.

Template

 

{#Category}

Total

Average

{#Product}

Total for {#Category}

Average for {#Category}

{#Year}

Total for {#Product}

Average for {#Product}

{Region}

{Sales}

{sum(Sales)}

{average(Sales)}

{sum(Sales)}

{average(Sales)}

{sum(Sales)}

{average(Sales)}

Position of a cross-tab header in a table

The whole cross-tab header must be inside a rectangular area, i.e. no cells may span across its sides.

Cells above the header may span across the cross-tab header columns, but such cells must not end or start between the header columns. Below you can find the examples for this rule, the pink color shows a cross-tab header.

Good:

Bad:









 











 










 










 









































 

The cells below the cross-tab header may not span across cross-tab columns.

Default values:

0

See also

Definitions of Report Workshop terms