Partager via


Totals in Data Views

A few people have asked about putting column totals in Data Views. Yes, you can do this! Ok, we could have made it easier to find (and I hope we will), but totals work just like inserting regular data items; the key is that you get the option for totals when insert an item into the header or footer of the view.

For example, to turn on the view footer, you click on the Style link in the Data View Details task pane to bring up the View Styles dialog. Choose the Options tab in the dialog and click the check box for Show view header, or Show view footer. Choose those options will add some space to the top or bottom of your data view respectively. Once you have a view header or footer, you can drag or insert data items into them and you will be presented with some on-object user interface (we just say OOUI, a little icon next to the data item you can click on) for choosing options for totals. If the data item is a numeric field, you get options for: Sum, Count, Average, Max, Min. You can also set a filter for the total so for example, you can create a footer with different totals based on different filter values, such as total sales where account rep equals Joe Smith. You can lay out the totals any where you want (not just under the columns) using any HTML constructs in the header/footers. 

I’ll also note that you can use the totals feature in group headers and footers, but I’ll save that for another post. What other types of things would you like to see for using totals in data views?

.: rob

Comments

  • Anonymous
    May 05, 2004
    Thanks for this guys, I had looked at adding totals and given up before, the list view webpart's total at the top is annoying.
  • Anonymous
    May 05, 2004
    This is just the kind of thing I was hoping to see here!
  • Anonymous
    May 21, 2004
    Just to think that I used to spend hours in the past to achieve the same effect. You get 10 points for creativity [bravo] but 3 points for usability [ship this type of documentation as a video - please].