Home » Sharepoint

How to display/calculate total of a custom column in dataview webpart's grouping header


I've created a dataview from a MOSS2007 form library. In the dataview, I've enabled grouping by a specific column and also was able to show the total (sum) of couple of columns like this, in the group heading:

<xsl:value-of select=”sum($nodeset/@Total_x0020_Cost)” />

So far, it's working fine. I've added couple more columns to this dataview. There's a piece of javascript code that is executed for each row. These 2 columns gets their value from this javascript. Now, is there anyway, I can get the total/sum of these columns in the group heading.

Have you done something like this? Please advise.




1 Answer Found


Answer 1

Hi Pman,


Thanks to share your problem.


Do you mean that you have added  two columns  so you want to refresh the total  number of the columns?


If yes, I think the following links would properly give you a hand:






Best Regards!







I have a an issue in caliculating the rowgroup totals. There are 3 student who are appreaed for the exams for different subjects. i have displayed teh same in matrix table like below


  Exam Group1The current Overal Pass Status isOveral Pass Status Should be
Java (Marks)Pass StatusSQL
Pass Status  
slnoStudent Name      
1           A20       1        10       0         00
2            B10        0        20       1        00
    3            C30        1       30       1        11
Total Passed 2        2        41
Total Failed 1       1        22




 The problem is at totals last column i.e The total overal passed students should be 1 instead it is  showing as 4 (2+2). The Tablix is doing the total caliculations like, the column group total is done on the row group totals instead of the same colun group values. Please help me out.


Total Passed 2 2         4 1
Total Failed 1 1         2 2


Thanks in advance,



Hi all,

I have a view where i group the projects and their hours per week. I can get totals for the hours for the groups per week and based on that we do a calculation to see if we are overtime or under. Is there a was to sum all the totals from each group? I need to group by week first to caculate the week overtime and then see the total overtime. Any ideas?

  Week     Hours Worked         Overtime (based on 37.5)


   24               39                             +1,5

   25               37                              -0,5 


                               Total Overtime: +1



Hi, Please help

I am using RS2008
I have a Tablix with a row grouping by Location and a row field Totalling the current employee count for that state

I have three adjacent columns grouping by Month, based on what month is selected in the multivalue-parameter, one column returns back number of employees joined for those months. second column how many left for those month. The third column the total headcount for those months

FOR Example if the parameter selected was Jan, Feb, March, the below would be returned

                                 JOIN                   LEFT                  HEADCOUNT
     CURRENT      Jan  Feb March         Jan Feb March         Jan Feb March 
WA     15              2    3    4                 3    1     2            14   16    18
VIC    23              1    4    5                 3    4     1             21   21    28

In the headcount I would like the total headcount to be a running value
ie for the WA Jan Headcount column it should be Current + Join - Left = 15 + 2 - 3 = 14

In february I would like to use the Value which was calculated in the month of January
i.e 14 + Join - Left = 14 + 3 - 1 = 16

In March it would use the Value which was calculated in the month of Feb
16 + join - Left = 16 + 4 - 2 = 18

The value I have under the Column month grouping is

Sum(field.currentemployee.value,"Location") + sum(field.join.value) - sum(field.left.value)

This is the correct number for the Jan column headcount but for Feb and MARCH The starting value is incorrect. Because the Months are dynamic Im not sure how to do this

The output above is what I would like to achieve...can anyone please help on this problem, can this be done at all ?

thanks in advance


I have a column grouped matrix report that shows count, cost and duration.  Duration is time in seconds.  To format the time on the report as hh:mm:ss I send it through a code block that converts the int to a string. 

When the report is generated the total column is NOT code.convert(sum(Fields!Duration.Value)).  At first I thought it was taking the max value, then I thought it is was taking the first value.. not really sure how it is calculating the value.

I did trying wrapping the expression like this IIF(InScope("matrixgroup"), Code.Convert(Fields!Duration.Value), Code.Convert(Sum(Fields!Duration.Value))).  It didn't make a difference the column is still incorrect.

If I remove the Code.Convert from the column, the value is correct.

Does anyone have any suggestions?




I'm rewriting an existing report in Report Builder 3.0. This report is grouped on two columns; Status and Category (ordered by Status, then Category). When the Status changes, I want a subtotal. Currently, I've got a grouping of Status and Category which wants to total after each unique change.  I can overcome this in the query with a total union but I would like to get it working in Report Builder.

Open   Claims

Open   Agency

Open   Provider

           Open Total

Closed  Claims

Closed  Agency

Closed Provider

           Closed Total



 I created a report using Report Builder 2008. The report is a multi columnar(using 3 columns) report. The report contains 2 parent groups on top of the Detail group. It looks like this

Restaurant ( Parent of Group 1)    

Chillis ( Group 1 - Parent of Detail row)

Quesadilla (Detail row)

Egg Rolls



spinach dip



Nacho cheese dip





The description in brackets is not present in the report. I wrote it here for understanding purpose. Whichever Detail value starts on a new page, that first Detail value's Group name(Group 1) need to be displayed on the Page Header. Please help me with this.


I have a list with a calculated column named 'FullName', the formula is: "FirstName & " " &  LastName". I created a view group by 'FullName' column. The follow error appeared on the column:

&lt;!-- #RENDER FAILED --&gt;

Please help


I have a report with two row groupings:
Group1 - StatusGroup,
Child Group(2) - ApplicationID

In the details section is amongst other fields a value (LoanRequested). It is aggregated at the Group2 group level as Max(LoanRequested). Is ut possible to change the order in which Group2 is displayed under Group1, so that it looks something like this:

StatusGroup - ABC
 ApplicationID - B1002; Max(LoanRequested) - £2000.00
  Detail - 1
  Detail - 2
  ...Detail - n
 ApplicationID - A1111; Max(LoanRequested) - £1600.00
  Detail - 1
  Detail - 2
  ...Detail - n
 ApplicationID - L0002; Max(LoanRequested) - £1000.00
  Detail - 1
  Detail - 2
  ...Detail - n

Can anyone help, the grouping in SSRS 2008 is a bit of a dark art



I have WPF DataGrid that is bound to and entity.

The DataGrid has a "Difference" column that is computed from the difference between two other columns in the same DataGrid.

Now I have a TextBox outside the data grid that should contain Sum of all cells in the "Difference" column.

How do I do that?


<DataGrid AutoGenerateColumns="False" HorizontalAlignment="Stretch" Margin="5,35,150,40" Name="BoxCountDataGrid" VerticalAlignment="Stretch" ItemsSource="{Binding UpdateSourceTrigger=PropertyChanged, Path=DemersalBoxCounts}" >


                              <DataGridTextColumn.HeaderTemplate >
                    <TextBlock Text="Recorded Box Unit/Weight(kg)" Width="70" TextWrapping="Wrap"/>

              <DataGridTextColumn Binding="{Binding DEBC_BCT}" Width="*">
                <DataGridTextColumn.HeaderTemplate >
                    <TextBlock Text="Box Count" Width="70" TextWrapping="Wrap"/>

              <DataGridTextColumn Binding="{Binding DEBC_VCT}" Width="*">
                <DataGridTextColumn.HeaderTemplate >
                    <TextBlock Text="Verification Count" Width="70" TextWrapping="Wrap"/>

              <DataGridTextColumn Width="*" x:Name="difference" Binding="{Binding Path=Sum,UpdateSourceTrigger=PropertyChanged}">
                <DataGridTextColumn.HeaderTemplate >
                    <TextBlock Text="Differences" Width="70" TextWrapping="Wrap"/>



I have a dataview webpart which Im trying to display the latest report of different categories from a site. The dataview is displaying all documents of content type "Report" and  is grouped by report type (which is a field in the report content type) eg Sales, Marketing etc.

My problem is that I cant find how to display 1 item per group, so I can show only the latest report per group. I have 10 groups and I want to display only 1 report per group. At the moment if I limit the webpart to show only 10 items it will show the last 10 reports of the first group.

Any help would be much appreciated



Hello all,

I am puzzled at what is going on here.

I have a Person or Group type (Presence: picture with name) column called 'Person'. I added a DataView into sharepoint designer and could not see the picture of person but instead name of person.

Using this article [http://vspug.com/joed/2008/03/17/displaying-users-with-presence-in-xslt-data-view/] I changed the following (disable-output-escaping="yes")

<td class="ms-vb">
    <xsl:value-of select="@Person" disable-output-escaping="yes"  />

However, I still can't see any pictures?

Can you please guide me if I am missing something here.

Thanks in advance.


Hi All, I need one help...

my source is having column1...




I need a query to display my output like this...

column1  totalSum
   2           14
   3           14
   4           14
   5           14

Thanks in Advance,





When using the PivotViewer is it possible to view the total records in each column and the total records in the all grid?

Everytime we change the order or the filter, new results are displayed (grid/graph) but we don't see how many records are displayed.

It would be great to have these counters and in case of being displayed as graph, have the percentage of each column also.


Total records: 200 (displayed before the sort box)

Column A: 50 (25%) (displayed in the column description at the bottom)

Column B: 75 (37,5%)

Column C: 75 (37,5%)



I've set up a dataformwebpart (from a SQL view) that shows a list of orders grouped by salesperson, I've succesfully created a formula that sums the total value of the orders in the group header but when I open the page the column names within the group that is collapsed are still visible. If I expand then collapse the group manually it hides the group column names as I wanted but when the page refreshes it shows the column names again! All I wanted to achieve is to have a headline figure, that is all, that is then expandable to show column names and the data, having the column names underneath the headline figure makes it look very messy.


Does anyone know why this is happening and have any suggestions?

Any help greatly appreciated.




I am using SRSS 2008.

I have a matrix with a number of column groups. The value that displays in this column header is null and thus the matrix does not group by this value.

But when running the report it continues to show the header even though no data exists.

The report in question was an SRSS2005 which I converted to SRS2008 by opening up the rdl in SRSS 2008 and this did not occur in the previous version.

Since I have a deadline I am looking for the solution but hoped someone might have seen this before?


I am new to Sql Server Reporting Services. I am using SQL Server Reporting Services 2005. I have a report with multiple groups and in detail section I have a subreport. The subreport has only one field. Some times the length of the field can be more than 30000 or 40000 chars. I have kept the group header to repeat in all pages. When the sub report extends to more than 1 page the group header is not displaying in all the other pages for that particular group.

Can any one help me to resolve this issue?


I seem to have missed something somewhere.

How do you get a report organized like:


Rather than:



Hello all,

I have a report with few grouping levels. by default few of the group levels are visible, while for a detailed report either specific group need to be collapsed, or detailed report option to be chosen.

Since in the group summary line I have few statistics, I want the report column header/names to be changed dynamically. I have used expression in header so it will change dynamically when a user wish to see the detailed or summary report using:

=IIf(Parameters!P_Detailed_Report.Value="Y","Detailed column header ","Summary column Header")

But the above won't work off course when the user actively collapses a group.

Can I have the header text to change when a certain group is collapsed by user ? 





I created a calculated site column that multiplies two other columns together.  Then all 3 columns are added to a custom content type.  I then create a list based on that content type.  This is all done in SharePoint Designer 2010.  When I go the the SharePoint site and try to modify the view, the calculated column is not available but the other two fields are.  Are calculated column not fully supported?

Also, once I have added the calculated column to the content type, the column is greyed in SharePoint Designer and I am not able to remove the column from the content type.  I cannot delete the content type either.  It says it's in use even after I have deleted the list that was using it. Is there some hidden trick to using calulated columns or do they just not work.


<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure