Crosstab Corner, Fact Cell, and Default Measure

The crosstab element typically contains crosstabCorner, crosstabFactCell and defaultMeasure child elements. All crosstab elements require these three child elements. The following is the portion of the XML for these three elements. The key parts are shown in bold.
<crosstab refQuery="Query1">
  <style>
    ...
  </style>
  <crosstabColumns>
   ...
  </crosstabColumns>
  <crosstabRows>
   ...
  </crosstabRows>

<crosstabCorner> 
 <contents>
  <textItem>
   <dataSource>
    <dataItemLabel refDataItem="Return quantity"/> 
   </dataSource>
  </textItem>
 </contents>
 <style>
  <defaultStyles>
   <defaultStyle refStyle="xm"/>
  </defaultStyles>
 </style>
 </crosstabCorner> 
 <defaultMeasure refDataItem="Return quantity"/> 
 <crosstabFactCell applySingleDefaultStyle="true"> 
  <contents>
   <textItem>
    <dataSource>
     <cellValue/>
    </dataSource>
   </textItem>
  </contents>
  <style>
   <defaultStyles>
    <defaultStyle refStyle="mv"/>
   </defaultStyles>
  </style>
 </crosstabFactCell> 

The crosstabCorner element defines the contents of the cell at the upper left corner of the crosstab. In this sample, the crosstabCorner contains the label for the Return quantity data item. The refDataItem attribute specifies the data item to reference.

The crosstabFactCell element defines the contents of the cells in the crosstab grid. These cells display measures at the intersection points of the rows and columns. In this sample, the child element of dataSource is cellValue. The cellValue element renders data in the report according to information on the edges and in the defaultMeasure element as follows.

  • If one of the edges contains a data item that is a measure, the report grid contains the measure.
  • If neither edge contains a data item that is a measure, the report grid contains the data item referenced in the defaultMeasure element.

The defaultMeasure child element uses the refDataItem attribute to specify data item to use if the data item on the edge is not a measure. In this sample, the default measure is Return quantity.