Adding subtotals for each group

Sometimes we need to show the subtotal of each group. Let's create subtotals for each group in our report:

  1. Let's create two new cells on our group header:

    Add the following expression on the cell just right above Qty:

    =Sum(Fields!Qty.Value)
    

    Add the following expression on the next cell to the right (Line Total):

    =Sum(Fields!LineTotal.Value)
    
  2. Set the Text Box Properties of both cells according to their types: Number for Qty and Currency for the Line Total. You can accomplish this by right-clicking on each cell then select Text Box Properties (Number).
  3. Let's also select the three other cells: Date, Sales Order ID, and Unit Price, and right-click on it, then select Merge Cells. Add the following expression:
    ="Subtotal for " & (Fields!Product.Value)
    
  4. Set the Text Properties of the merged cell to the appropriate format. We can be fancy with all the font and cell settings. Let's just keep it simple for the purpose of this demonstration, and make the expression bold.

This is how the designer looks like after we added the new cells and made afew changes:

Adding subtotals for each group
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.18.198