3.19 Table

Applies to RDL 2003/10 and RDL 2005/01

The following example of a Table element is an extract from an RDL specification of a report. This example is from a report for the Adventure Works database and shows year-to-date (YTD) sales and last year's sales for each salesperson grouped by region and sales territory. This example illustrates the use of a table data region to provide a tabular grouped listing of data in a grid, providing subtotals for each of the two groups and a grand total for the whole table.

The following figure shows the Table example. The first and last rows of the table have a dark blue background color. These are the header and footer rows of the table. The header provides column headers and the footer provides grand totals of YTD sales and last year's sales. The rows with the medium blue background color present subtotals of sales for all the territories within a region. The rows with the light blue background color present the subtotals of sales for all the salespersons within a territory. The rows with the white background color are the detail rows of the table, which provide the sales information for each salesperson.

Example of a table with grouping and totals rows

Figure 28: Example of a table with grouping and totals rows

The following is the extract from the RDL report file that produces the preceding table. The Table element has its Name attribute set to "table1". The table is bound to the data in the DataSet AdventureWorks by the Table.DataSetName element. The Top element specifies that the table is 0.33 inches from the top edge of its containing report item, which is the body of the report.

  
   <Table Name="table1">
     <DataSetName>AdventureWorks</DataSetName>
     <Top>0.33in</Top>
     <TableGroups>

This table has two TableGroup elements in its TableGroups collection. This is an ordered list that specifies the groupings from outermost to innermost. The first TableGroup element specifies a grouping by region.

The Grouping element that has its Name attribute set to "table1_Region" that specifies that the data is grouped by the expression =Fields!Region.Value; that is, the data is grouped by the Field "Region". The Sorting element specifies that this group is sorted by the Field "Region" in ascending order. This is shown in the figure where the regions listed are Europe, North America, and Pacific, which are sorted in alphabetical (ascending) order.

       <TableGroup>
         <Grouping Name="table1_Region">
           <GroupExpressions>
             <GroupExpression>=Fields!Region.Value</GroupExpression>
           </GroupExpressions>
         </Grouping>
         <Sorting>
           <SortBy>
             <SortExpression>=Fields!Region.Value</SortExpression>
             <Direction>Ascending</Direction>
           </SortBy>
         </Sorting>

The Footer element of the TableGroup specifies the rows in the figure that are medium blue in color. These are the lines that represent the total sales for all territories in a region. The Textbox that has its Name attribute value set to "textbox7" specifies the Total label. The text boxes with Name attribute values "textbox10" and "textbox11" specify expressions by using the aggregate function Sum to total all the YTD and last year's sales values in this grouping scope.

         <Footer>
           <TableRows>
             <TableRow>
               <TableCells>
                 <TableCell>
                   <ReportItems>
                     <Textbox Name="textbox7">
                       <rd:DefaultName>textbox7</rd:DefaultName>
                       <Style>
                         <Color>White</Color>
                         <BackgroundColor>#60759b</BackgroundColor>
                         <BorderColor>
                           <Default>DimGray</Default>
                         </BorderColor>
                         <BorderStyle>
                           <Default>Solid</Default>
                         </BorderStyle>
                         <FontFamily>Tahoma</FontFamily>
                         <PaddingLeft>2pt</PaddingLeft>
                         <PaddingRight>2pt</PaddingRight>
                         <PaddingTop>2pt</PaddingTop>
                         <PaddingBottom>2pt</PaddingBottom>
                       </Style>
                       <ZIndex>14</ZIndex>
                       <CanGrow>true</CanGrow>
                       <Value>Total</Value>
                     </Textbox>
                   </ReportItems>
                 </TableCell>
                 <TableCell>
                   <ReportItems>
                     <Textbox Name="textbox8">
                       <rd:DefaultName>textbox8</rd:DefaultName>
                       <Style>
                         <Color>White</Color>
                         <BackgroundColor>#60759b</BackgroundColor>
                         <BorderColor>
                           <Default>DimGray</Default>
                         </BorderColor>
                         <BorderStyle>
                           <Default>Solid</Default>
                         </BorderStyle>
                         <FontFamily>Tahoma</FontFamily>
                         <PaddingLeft>2pt</PaddingLeft>
                         <PaddingRight>2pt</PaddingRight>
                         <PaddingTop>2pt</PaddingTop>
                         <PaddingBottom>2pt</PaddingBottom>
                       </Style>
                       <ZIndex>13</ZIndex>
                       <CanGrow>true</CanGrow>
                       <Value>
                       </Value>
                     </Textbox>
                   </ReportItems>
                 </TableCell>
                 <TableCell>
                   <ReportItems>
                     <Textbox Name="textbox9">
                       <rd:DefaultName>textbox9</rd:DefaultName>
                       <Style>
                         <Color>White</Color>
                         <BackgroundColor>#60759b</BackgroundColor>
                         <BorderColor>
                           <Default>DimGray</Default>
                         </BorderColor>
                         <BorderStyle>
                           <Default>Solid</Default>
                         </BorderStyle>
                         <FontFamily>Tahoma</FontFamily>
                         <PaddingLeft>2pt</PaddingLeft>
                         <PaddingRight>2pt</PaddingRight>
                         <PaddingTop>2pt</PaddingTop>
                         <PaddingBottom>2pt</PaddingBottom>
                       </Style>
                       <ZIndex>12</ZIndex>
                       <CanGrow>true</CanGrow>
                       <Value>
                       </Value>
                     </Textbox>
                   </ReportItems>
                 </TableCell>
                 <TableCell>
                   <ReportItems>
                     <Textbox Name="textbox10">
                       <rd:DefaultName>textbox10</rd:DefaultName>
                       <Style>
                         <Color>White</Color>
                         <BackgroundColor>#60759b</BackgroundColor>
                         <BorderColor>
                           <Default>DimGray</Default>
                         </BorderColor>
                         <BorderStyle>
                           <Default>Solid</Default>
                         </BorderStyle>
                         <FontFamily>Tahoma</FontFamily>
                         <PaddingLeft>2pt</PaddingLeft>
                         <PaddingRight>2pt</PaddingRight>
                         <PaddingTop>2pt</PaddingTop>
                         <PaddingBottom>2pt</PaddingBottom>
                       </Style>
                       <ZIndex>11</ZIndex>
                       <CanGrow>true</CanGrow>
                       <Value>=Round(Sum(Fields!Sales___YTD.Value))</Value>
                     </Textbox>
                   </ReportItems>
                 </TableCell>
                 <TableCell>
                   <ReportItems>
                     <Textbox Name="textbox11">
                       <rd:DefaultName>textbox11</rd:DefaultName>
                       <Style>
                         <Color>White</Color>
                         <BackgroundColor>#60759b</BackgroundColor>
                         <BorderColor>
                           <Default>DimGray</Default>
                         </BorderColor>
                         <BorderStyle>
                           <Default>Solid</Default>
                         </BorderStyle>
                         <FontFamily>Tahoma</FontFamily>
                         <PaddingLeft>2pt</PaddingLeft>
                         <PaddingRight>2pt</PaddingRight>
                         <PaddingTop>2pt</PaddingTop>
                         <PaddingBottom>2pt</PaddingBottom>
                       </Style>
                       <ZIndex>10</ZIndex>
                       <CanGrow>true</CanGrow>
                       <Value>=Round(Sum(Fields!Sales___Last_Year.Value))</Value>
                     </Textbox>
                   </ReportItems>
                 </TableCell>
               </TableCells>
               <Height>0.21in</Height>
             </TableRow>
           </TableRows>
         </Footer>
       </TableGroup>

The second TableGroup element in the following RDL specifies a grouping by sales territory. There is a Grouping element with the Name attribute "table1_Sales_Territory" that specifies that the data is grouped by the expression =Fields! Sales_Territory.Value; that is, the data is grouped by the Field "Sales_Territory". A Sorting element specifies that this group is sorted by the Field Sales_Territory in ascending order. This is shown in the figure where the sales territories listed are France, Germany, and United Kingdom, under the region Europe, and these are sorted in alphabetical (ascending) order.

       <TableGroup>
         <Grouping Name="table1_Sales_Territory">
           <GroupExpressions>
             <GroupExpression>=Fields!Sales_Territory.Value</GroupExpression>
           </GroupExpressions>
         </Grouping>
         <Sorting>
           <SortBy>
             <SortExpression>=Fields!Sales_Territory.Value</SortExpression>
             <Direction>Ascending</Direction>
           </SortBy>
         </Sorting>

The Footer element of this TableGroup specifies the rows in the figure that are light blue in color. These are the lines that represent the total sales for all salespersons within a sales territory. The Textbox with the Name attribute value "textbox13" specifies the label "subtotal". The text boxes with Name attribute values "textbox15" and "textbox16" specify expressions by using the aggregate function Sum to total all the YTD and last year's sales values in this grouping scope.

         <Footer>
           <TableRows>
             <TableRow>
               <TableCells>
                 <TableCell>
                   <ReportItems>
                     <Textbox Name="textbox12">
                       <rd:DefaultName>textbox12</rd:DefaultName>
                       <Style>
                         <BackgroundColor>LightSteelBlue</BackgroundColor>
                         <BorderColor>
                           <Default>DimGray</Default>
                         </BorderColor>
                         <BorderStyle>
                           <Default>Solid</Default>
                         </BorderStyle>
                         <FontFamily>Tahoma</FontFamily>
                         <PaddingLeft>2pt</PaddingLeft>
                         <PaddingRight>2pt</PaddingRight>
                         <PaddingTop>2pt</PaddingTop>
                         <PaddingBottom>2pt</PaddingBottom>
                       </Style>
                       <ZIndex>9</ZIndex>
                       <CanGrow>true</CanGrow>
                       <Value>
                       </Value>
                     </Textbox>
                   </ReportItems>
                 </TableCell>
                 <TableCell>
                   <ReportItems>
                     <Textbox Name="textbox13">
                       <rd:DefaultName>textbox13</rd:DefaultName>
                       <Style>
                         <BackgroundColor>LightSteelBlue</BackgroundColor>
                         <BorderColor>
                           <Default>DimGray</Default>
                         </BorderColor>
                         <BorderStyle>
                           <Default>Solid</Default>
                         </BorderStyle>
                         <FontStyle>Italic</FontStyle>
                         <FontFamily>Tahoma</FontFamily>
                         <PaddingLeft>2pt</PaddingLeft>
                         <PaddingRight>2pt</PaddingRight>
                         <PaddingTop>2pt</PaddingTop>
                         <PaddingBottom>2pt</PaddingBottom>
                       </Style>
                       <ZIndex>8</ZIndex>
                       <CanGrow>true</CanGrow>
                       <Value>Subtotal</Value>
                     </Textbox>
                   </ReportItems>
                 </TableCell>
                 <TableCell>
                   <ReportItems>
                     <Textbox Name="textbox14">
                       <rd:DefaultName>textbox14</rd:DefaultName>
                       <Style>
                         <BackgroundColor>LightSteelBlue</BackgroundColor>
                         <BorderColor>
                           <Default>DimGray</Default>
                         </BorderColor>
                         <BorderStyle>
                           <Default>Solid</Default>
                         </BorderStyle>
                         <FontFamily>Tahoma</FontFamily>
                         <PaddingLeft>2pt</PaddingLeft>
                         <PaddingRight>2pt</PaddingRight>
                         <PaddingTop>2pt</PaddingTop>
                         <PaddingBottom>2pt</PaddingBottom>
                       </Style>
                       <ZIndex>7</ZIndex>
                       <CanGrow>true</CanGrow>
                       <Value>
                       </Value>
                     </Textbox>
                   </ReportItems>
                 </TableCell>
                 <TableCell>
                   <ReportItems>
                     <Textbox Name="textbox15">
                       <rd:DefaultName>textbox15</rd:DefaultName>
                       <Style>
                         <BackgroundColor>LightSteelBlue</BackgroundColor>
                         <BorderColor>
                           <Default>DimGray</Default>
                         </BorderColor>
                         <BorderStyle>
                           <Default>Solid</Default>
                         </BorderStyle>
                         <FontFamily>Tahoma</FontFamily>
                         <PaddingLeft>2pt</PaddingLeft>
                         <PaddingRight>2pt</PaddingRight>
                         <PaddingTop>2pt</PaddingTop>
                         <PaddingBottom>2pt</PaddingBottom>
                       </Style>
                       <ZIndex>6</ZIndex>
                       <CanGrow>true</CanGrow>
                       <Value>=ROUND(Sum(Fields!Sales___YTD.Value))</Value>
                     </Textbox>
                   </ReportItems>
                 </TableCell>
                 <TableCell>
                   <ReportItems>
                     <Textbox Name="textbox16">
                       <rd:DefaultName>textbox16</rd:DefaultName>
                       <Style>
                         <BackgroundColor>LightSteelBlue</BackgroundColor>
                         <BorderColor>
                           <Default>DimGray</Default>
                         </BorderColor>
                         <BorderStyle>
                           <Default>Solid</Default>
                         </BorderStyle>
                         <FontFamily>Tahoma</FontFamily>
                         <PaddingLeft>2pt</PaddingLeft>
                         <PaddingRight>2pt</PaddingRight>
                         <PaddingTop>2pt</PaddingTop>
                         <PaddingBottom>2pt</PaddingBottom>
                       </Style>
                       <ZIndex>5</ZIndex>
                       <CanGrow>true</CanGrow>
  
               Value>=Round(Sum(Fields!Sales___Last_Year.Value))</Value>
                   </Textbox>
                 </ReportItems>
               </TableCell>
             </TableCells>
             <Height>0.21in</Height>
           </TableRow>
         </TableRows>
       </Footer>
     </TableGroup>
   </TableGroups>

The Details element of this Table specifies the rows in the figure that have a white background color. These are the rows that represent the details of sales for each salesperson within a sales territory. The text boxes with the Name attribute values "Region" and "Sales_Territory" specify the values of the region and sales territory for a given salesperson. The Textbox.HideDuplicates element specifies that only the first occurrence of each of these will appear within their respective groups. This is why the values North America and Canada are not repeated for the details row for salesperson Garrett R Vargas in the figure. The Textbox with the Name attribute value "Sales_Person" specifies the name of the salesperson. The remaining two text boxes specify the salesperson's YTD sales and last year's sales.

   <Details>
     <TableRows>
       <TableRow>
         <TableCells>
           <TableCell>
             <ReportItems>
               <Textbox Name="Region">
                 <rd:DefaultName>Region</rd:DefaultName>
                 <HideDuplicates>AdventureWorks</HideDuplicates>
                 <Style>
                   <BorderColor>
                     <Default>DimGray</Default>
                   </BorderColor>
                   <BorderStyle>
                     <Default>Solid</Default>
                   </BorderStyle>
                   <FontFamily>Tahoma</FontFamily>
                   <PaddingLeft>2pt</PaddingLeft>
                   <PaddingRight>2pt</PaddingRight>
                   <PaddingTop>2pt</PaddingTop>
                   <PaddingBottom>2pt</PaddingBottom>
                 </Style>
                 <ZIndex>4</ZIndex>
                 <CanGrow>true</CanGrow>
                 <Value>=Fields!Region.Value</Value>
               </Textbox>
             </ReportItems>
           </TableCell>
           <TableCell>
             <ReportItems>
               <Textbox Name="Sales_Territory">
                 <rd:DefaultName>Sales_Territory</rd:DefaultName>
                 <HideDuplicates>AdventureWorks</HideDuplicates>
                 <Style>
                   <BorderColor>
                     <Default>DimGray</Default>
                   </BorderColor>
                   <BorderStyle>
                     <Default>Solid</Default>
                   </BorderStyle>
                   <FontFamily>Tahoma</FontFamily>
                   <PaddingLeft>2pt</PaddingLeft>
                   <PaddingRight>2pt</PaddingRight>
                   <PaddingTop>2pt</PaddingTop>
                   <PaddingBottom>2pt</PaddingBottom>
                 </Style>
                 <ZIndex>3</ZIndex>
                 <CanGrow>true</CanGrow>
                 <Value>=Fields!Sales_Territory.Value</Value>
               </Textbox>
             </ReportItems>
           </TableCell>
           <TableCell>
             <ReportItems>
               <Textbox Name="Sales_Person">
                 <rd:DefaultName>Sales_Person</rd:DefaultName>
                 <Style>
                   <BorderColor>
                     <Default>DimGray</Default>
                   </BorderColor>
                   <BorderStyle>
                     <Default>Solid</Default>
                   </BorderStyle>
                   <FontFamily>Tahoma</FontFamily>
                   <PaddingLeft>2pt</PaddingLeft>
                   <PaddingRight>2pt</PaddingRight>
                   <PaddingTop>2pt</PaddingTop>
                   <PaddingBottom>2pt</PaddingBottom>
                 </Style>
                 <ZIndex>2</ZIndex>
                 <CanGrow>true</CanGrow>
                 <Value>=Fields!Sales_Person.Value</Value>
               </Textbox>
             </ReportItems>
           </TableCell>
           <TableCell>
             <ReportItems>
               <Textbox Name="Sales___YTD">
                 <rd:DefaultName>Sales___YTD</rd:DefaultName>
                 <Style>
                   <BorderColor>
                     <Default>DimGray</Default>
                   </BorderColor>
                   <BorderStyle>
                     <Default>Solid</Default>
                   </BorderStyle>
                   <FontFamily>Tahoma</FontFamily>
                   <PaddingLeft>2pt</PaddingLeft>
                   <PaddingRight>2pt</PaddingRight>
                   <PaddingTop>2pt</PaddingTop>
                   <PaddingBottom>2pt</PaddingBottom>
                 </Style>
                 <ZIndex>1</ZIndex>
                 <CanGrow>true</CanGrow>
                 <Value>=Round(Fields!Sales___YTD.Value)</Value>
               </Textbox>
             </ReportItems>
           </TableCell>
           <TableCell>
             <ReportItems>
               <Textbox Name="Sales___Last_Year">
                 <rd:DefaultName>Sales___Last_Year</rd:DefaultName>
                 <Style>
                   <BorderColor>
                     <Default>DimGray</Default>
                   </BorderColor>
                   <BorderStyle>
                     <Default>Solid</Default>
                   </BorderStyle>
                   <FontFamily>Tahoma</FontFamily>
                   <PaddingLeft>2pt</PaddingLeft>
                   <PaddingRight>2pt</PaddingRight>
                   <PaddingTop>2pt</PaddingTop>
                   <PaddingBottom>2pt</PaddingBottom>
                 </Style>
                 <CanGrow>true</CanGrow>
                 <Value>=Round(Fields!Sales___Last_Year.Value)</Value>
               </Textbox>
             </ReportItems>
           </TableCell>
         </TableCells>
         <Height>0.21in</Height>
       </TableRow>
     </TableRows>

The following Sorting element specifies that the details are sorted by the Field "LastName" in ascending order. We see this in the preceding figure where the salespersons in the Northwest Territory of the North America region are Pamela O Ansman-Wolfe, David R Campbell, and Tete A Mensa-Annan, who are sorted in alphabetical (ascending) order by their last name. Note that the Field "Sales_Person" is not used to sort the details because this would sort the salespersons by their full name, which would sort them by their first name.

     <Sorting>
       <SortBy>
         <SortExpression>=Fields!LastName.Value</SortExpression>
         <Direction>Ascending</Direction>
       </SortBy>
     </Sorting>
   </Details>

The Header element specifies the header rows of the table, which is the very first row in the figure. This is the dark blue row that contains the column headers.

   <Header>
     <TableRows>
       <TableRow>
         <TableCells>
           <TableCell>
             <ReportItems>
               <Textbox Name="textbox2">
                 <rd:DefaultName>textbox2</rd:DefaultName>
                 <Style>
                   <Color>White</Color>
                   <BackgroundColor>#1c3a70</BackgroundColor>
                   <BorderColor>
                     <Default>DimGray</Default>
                   </BorderColor>
                   <BorderStyle>
                     <Default>Solid</Default>
                   </BorderStyle>
                   <FontFamily>Tahoma</FontFamily>
                   <FontSize>11pt</FontSize>
                   <FontWeight>700</FontWeight>
                   <PaddingLeft>2pt</PaddingLeft>
                   <PaddingRight>2pt</PaddingRight>
                   <PaddingTop>2pt</PaddingTop>
                   <PaddingBottom>2pt</PaddingBottom>
                 </Style>
                 <ZIndex>24</ZIndex>
                 <CanGrow>true</CanGrow>
                 <Value>Region</Value>
               </Textbox>
             </ReportItems>
           </TableCell>
           <TableCell>
             <ReportItems>
               <Textbox Name="textbox3">
                 <rd:DefaultName>textbox3</rd:DefaultName>
                 <Style>
                   <Color>White</Color>
                   <BackgroundColor>#1c3a70</BackgroundColor>
                   <BorderColor>
                     <Default>DimGray</Default>
                   </BorderColor>
                   <BorderStyle>
                     <Default>Solid</Default>
                   </BorderStyle>
                   <FontFamily>Tahoma</FontFamily>
                   <FontSize>11pt</FontSize>
                   <FontWeight>700</FontWeight>
                   <PaddingLeft>2pt</PaddingLeft>
                   <PaddingRight>2pt</PaddingRight>
                   <PaddingTop>2pt</PaddingTop>
                   <PaddingBottom>2pt</PaddingBottom>
                 </Style>
                 <ZIndex>23</ZIndex>
                 <CanGrow>true</CanGrow>
                 <Value>Sales Territory</Value>
               </Textbox>
             </ReportItems>
           </TableCell>
           <TableCell>
             <ReportItems>
               <Textbox Name="textbox4">
                 <rd:DefaultName>textbox4</rd:DefaultName>
                 <Style>
                   <Color>White</Color>
                   <BackgroundColor>#1c3a70</BackgroundColor>
                   <BorderColor>
                     <Default>DimGray</Default>
                   </BorderColor>
                   <BorderStyle>
                     <Default>Solid</Default>
                   </BorderStyle>
                   <FontFamily>Tahoma</FontFamily>
                   <FontSize>11pt</FontSize>
                   <FontWeight>700</FontWeight>
                   <PaddingLeft>2pt</PaddingLeft>
                   <PaddingRight>2pt</PaddingRight>
                   <PaddingTop>2pt</PaddingTop>
                   <PaddingBottom>2pt</PaddingBottom>
                 </Style>
                 <ZIndex>22</ZIndex>
                 <CanGrow>true</CanGrow>
                 <Value>Sales Person</Value>
               </Textbox>
             </ReportItems>
           </TableCell>
           <TableCell>
             <ReportItems>
               <Textbox Name="textbox5">
                 <rd:DefaultName>textbox5</rd:DefaultName>
                 <Style>
                   <Color>White</Color>
                   <BackgroundColor>#1c3a70</BackgroundColor>
                   <BorderColor>
                     <Default>DimGray</Default>
                   </BorderColor>
                   <BorderStyle>
                     <Default>Solid</Default>
                   </BorderStyle>
                   <FontFamily>Tahoma</FontFamily>
                   <FontSize>11pt</FontSize>
                   <FontWeight>700</FontWeight>
                   <TextAlign>Right</TextAlign>
                   <PaddingLeft>2pt</PaddingLeft>
                   <PaddingRight>2pt</PaddingRight>
                   <PaddingTop>2pt</PaddingTop>
                   <PaddingBottom>2pt</PaddingBottom>
                 </Style>
                 <ZIndex>21</ZIndex>
                 <CanGrow>true</CanGrow>
                 <Value>Sales YTD</Value>
               </Textbox>
             </ReportItems>
           </TableCell>
           <TableCell>
             <ReportItems>
               <Textbox Name="textbox6">
                 <rd:DefaultName>textbox6</rd:DefaultName>
                 <Style>
                   <Color>White</Color>
                   <BackgroundColor>#1c3a70</BackgroundColor>
                   <BorderColor>
                     <Default>DimGray</Default>
                   </BorderColor>
                   <BorderStyle>
                     <Default>Solid</Default>
                   </BorderStyle>
                   <FontFamily>Tahoma</FontFamily>
                   <FontSize>11pt</FontSize>
                   <FontWeight>700</FontWeight>
                   <TextAlign>Right</TextAlign>
                   <PaddingLeft>2pt</PaddingLeft>
                   <PaddingRight>2pt</PaddingRight>
                   <PaddingTop>2pt</PaddingTop>
                   <PaddingBottom>2pt</PaddingBottom>
                 </Style>
                 <ZIndex>20</ZIndex>
                 <CanGrow>true</CanGrow>
                 <Value>Sales Last Year</Value>
               </Textbox>
             </ReportItems>
           </TableCell>
         </TableCells>
         <Height>0.22in</Height>
       </TableRow>
     </TableRows>
     <RepeatOnNewPage>true</RepeatOnNewPage>
   </Header>

The TableColumns element specifies the widths of the five columns in the figure that show the example table.

   <TableColumns>
     <TableColumn>
       <Width>1.125in</Width>
     </TableColumn>
     <TableColumn>
       <Width>1.125in</Width>
     </TableColumn>
     <TableColumn>
       <Width>1.875in</Width>
     </TableColumn>
     <TableColumn>
       <Width>0.75in</Width>
     </TableColumn>
     <TableColumn>
       <Width>0.75in</Width>
     </TableColumn>
   </TableColumns>

The Footer element specifies the footer rows of the table, which is the very last row in the preceding figure. This is the dark blue row that contains the grand totals. The Textbox with the Name attribute value "textbox17" specifies the Grand Total label, which appears in the first column of the footer row. The text boxes with Name attribute values "textbox20" and "textbox21" specify expressions by using the aggregate function Sum to total all the YTD and last year's sales values for all salespersons.

   <Footer>
     <TableRows>
       <TableRow>
         <TableCells>
           <TableCell>
             <ReportItems>
               <Textbox Name="textbox17">
                 <rd:DefaultName>textbox17</rd:DefaultName>
                 <Style>
                   <Color>White</Color>
                   <BackgroundColor>#1c3a70</BackgroundColor>
                   <BorderColor>
                     <Default>DimGray</Default>
                   </BorderColor>
                   <BorderStyle>
                     <Default>Solid</Default>
                   </BorderStyle>
                   <FontFamily>Tahoma</FontFamily>
                   <FontSize>11pt</FontSize>
                   <FontWeight>700</FontWeight>
                   <PaddingLeft>2pt</PaddingLeft>
                   <PaddingRight>2pt</PaddingRight>
                   <PaddingTop>2pt</PaddingTop>
                   <PaddingBottom>2pt</PaddingBottom>
                 </Style>
                 <ZIndex>19</ZIndex>
                 <CanGrow>true</CanGrow>
                 <Value>Grand Total</Value>
               </Textbox>
             </ReportItems>
           </TableCell>
           <TableCell>
             <ReportItems>
               <Textbox Name="textbox18">
                 <rd:DefaultName>textbox18</rd:DefaultName>
                 <Style>
                   <BackgroundColor>#1c3a70</BackgroundColor>
                   <BorderColor>
                     <Default>DimGray</Default>
                   </BorderColor>
                   <BorderStyle>
                     <Default>Solid</Default>
                   </BorderStyle>
                   <PaddingLeft>2pt</PaddingLeft>
                   <PaddingRight>2pt</PaddingRight>
                   <PaddingTop>2pt</PaddingTop>
                   <PaddingBottom>2pt</PaddingBottom>
                 </Style>
                 <ZIndex>18</ZIndex>
                 <CanGrow>true</CanGrow>
                 <Value />
               </Textbox>
             </ReportItems>
           </TableCell>
           <TableCell>
             <ReportItems>
               <Textbox Name="textbox19">
                 <rd:DefaultName>textbox19</rd:DefaultName>
                 <Style>
                   <BackgroundColor>#1c3a70</BackgroundColor>
                   <BorderColor>
                     <Default>DimGray</Default>
                   </BorderColor>
                   <BorderStyle>
                     <Default>Solid</Default>
                   </BorderStyle>
                   <PaddingLeft>2pt</PaddingLeft>
                   <PaddingRight>2pt</PaddingRight>
                   <PaddingTop>2pt</PaddingTop>
                   <PaddingBottom>2pt</PaddingBottom>
                 </Style>
                 <ZIndex>17</ZIndex>
                 <CanGrow>true</CanGrow>
                 <Value />
               </Textbox>
             </ReportItems>
           </TableCell>
           <TableCell>
             <ReportItems>
               <Textbox Name="textbox20">
                 <rd:DefaultName>textbox20</rd:DefaultName>
                 <Style>
                   <Color>White</Color>
                   <BackgroundColor>#1c3a70</BackgroundColor>
                   <BorderColor>
                     <Default>DimGray</Default>
                   </BorderColor>
                   <BorderStyle>
                     <Default>Solid</Default>
                   </BorderStyle>
                   <PaddingLeft>2pt</PaddingLeft>
                   <PaddingRight>2pt</PaddingRight>
                   <PaddingTop>2pt</PaddingTop>
                   <PaddingBottom>2pt</PaddingBottom>
                 </Style>
                 <ZIndex>16</ZIndex>
                 <CanGrow>true</CanGrow>
                 <Value>=ROUND(Sum(Fields!Sales___YTD.Value))</Value>
               </Textbox>
             </ReportItems>
           </TableCell>
           <TableCell>
             <ReportItems>
               <Textbox Name="textbox21">
                 <rd:DefaultName>textbox21</rd:DefaultName>
                 <Style>
                   <Color>White</Color>
                   <BackgroundColor>#1c3a70</BackgroundColor>
                   <BorderColor>
                     <Default>DimGray</Default>
                   </BorderColor>
                   <BorderStyle>
                     <Default>Solid</Default>
                   </BorderStyle>
                   <PaddingLeft>2pt</PaddingLeft>
                   <PaddingRight>2pt</PaddingRight>
                   <PaddingTop>2pt</PaddingTop>
                   <PaddingBottom>2pt</PaddingBottom>
                 </Style>
                 <ZIndex>15</ZIndex>
                 <CanGrow>true</CanGrow>
                 <Value>=Round(Sum(Fields!Sales___Last_Year.Value))</Value>
               </Textbox>
             </ReportItems>
           </TableCell>
         </TableCells>
         <Height>0.25in</Height>
       </TableRow>
     </TableRows>
   </Footer>

The Table.Left element specifies that the table is placed 0.125 inches to the right of the left edge of its parent containing report item, which is the report body.

   <Left>0.125in</Left>
 </Table>