.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Add total in group footer for calculation with multiplication and sum

Posted By:      Posted Date: October 13, 2010    Points: 0   Category :Sql Server
Not sure if the topic title clarifies my problem correctly but this is what I'm trying to achieve:
I have a simple report, an overview of different projects grouped by accounts. Every project shows the revenue, the costs and the profit.
I want to have a total of all 3 colums, both in group footer as in the table footer. I know how to do a simple Sum(Fields!revenue.Value) but my calculation is a bit more complicated:


Basicly this adds up: Transportation cost (km*cost/km) + Preperation cost + Project Cost + Multiple other costs
The formula itself works perfectly.

Now when I have 3 projects with an account, I want to know the total. I've tried the following:
- =Sum(Formula)
- =Sum(km*cost/km) + Sum(Preperation cost + Sum(Project Cost) + Sum(MultipleOtherCosts)
- =Sum(ReportItems!textbox2.Value)

But either I get errors, or the total is incorrect because of the multiplication. The problem is I need to mulitplie km*cost/km first and not Sum(km)*Sum(Cost/km) because than the total is incorrect.

Is there someone who sees a solution for my problem?


View Complete Post

More Related Resource Links

Group Total in Footer (SSRS)



I am using SSRS and have a group named "G_Invoice" . In the footer I need to total the group's total. I used the following lines

=Sum( Fields!InvoiceAmount.Value ,"G_Invoice") in the textbox .

I also tried

=RunningValue(Fields!InvoiceAmount.Value ,sum,"G_Invoice")

In both the cases, it shows an error


The Value expression for the textbox ‘textbox27’ has a scope parameter that is not valid for an aggregate function.  The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a data set.


How to achieve it?





Show grand total running total in GridView Footer

In many scenarios we need to display Running total as well as Grand total in GridView footer. In this post i will try to explain in an easy way that how we can display running total & Grand total in a GridView footer combindly. To explain this solution using an example here i use a sales order report. The report contains all sales order amount in a tabular way. I will use a GridView to display sales order amount and use GridView footer to display Running total & Grand total. Let we have a customer table with id and name column plus an orders table with OrderID,CustomerID,OrderDate & Amount. Now our goal is to show all customers order with amount as well as page wise running total & grand total. Note that running total is necessary when you enable paging in a GridView where as Grand total is always you can consider.

Adding a footer to a pre-existing row group

Hi, I want to add a group footer to my report which includes the individual provider name for each page. I have already added a parent row group for details relating to each provider without specifying to include a footer to the row group. When I now add a footer using the insert footer path this places the footer below my row grouping, when I then add the provider field to the footer every page returns the first provider in the list. How do I include the footer to the grouping so ever footer relates to the individual provider type in the main body of the report? Thanks James

SSRS 2008 group footer totals on a new page has a non-expected large cell height

SSRS 2008 group footer totals on a new page has a non-expected large cell height. When the group total is the first component on a new page, then this happens, but when it is part of the group on but not the first component, then it reverts to normal cell height. I have played with the advance settings now for hours, but cannot get this to work. Any ideas?  

SSRS Report Group Total

I am trying to make a report in SSRS with Data source CUBE. I have a column which is calculated and inside the group. I could not take group total for that item. Please any guide my calculated column expression is =(Fields!Count_of_Passengers.Value/Sum(Fields!Count_of_Passengers.Value, "LHSH"))*100  

Display selected items total in gridview footer


Hi all,

           I will have a gridview with checkboxes and some amount fields. I would like to display the sum of the amount in gridview footer depending on the checked items by the user. Can any one give me a sample code

Percent of Total Calculation with Mixed Static and Dynamic Groups


Ok, here's one I'm really struggling with.  I have a report that has two dynamic row groups and three dynamic column groups that are nested beneath static column groups.  It looks similar to this:

                                                  Market Share                  Discharges                           LOS

                                                Column Group1               Column Group2               Column Group3

Row Group1  Row Group2       &

perform sum of textbox values and display the total in gridview footer row textbox


i have a gridview in which i have added two textboxes .

the second textbox is placed in footer of gridview

wht i want is when the user enters values in the first textbox the total of these textboxes should be displayed in footer row.

Pls help

How to get group count and total count using one select statement?


How to obtain the resultset using one select statement?


Table 1







access row group total from row details?

I need to access the total value for a row group from the row detail cells, how can I do this? 

Javier Guillen

Reporting Services Orphaned Group footer on PDF / Print

Good afternoon

The report I have created using reporting services (VS2005) has a group header which is set to repeat on every new page, and the group footer appears only at the end of the group.

It looks fine in preview mode, and also on the screen, However; when the report is exported to PDF or printed, If the group FOOTER has is pushed onto a new page because of a pagebreak, the group HEADER is not displayed on this new page.

Is there a fix for this?  I have spent hours searching on the web, but have not found a solution.


Sum Issue in Group Footer and report Footer


In attached SSRS 2005 report i am grouping by date and within date i'm showing acconuts.
In group footer i'm trying to do sum depends on TYPE field.
For Receipt Column
=IIf((Fields!Type1.Value= "R"),Sum(Fields!Amount.Value),"")
For Disbursement Column
=IIf((Fields!Type1.Value= "D"),Sum(Fields!Amount.Value),"")

But report is putting sum either in RECEIPT or in DISBURSEMENT column depends on whatever record is 1st.

For Receipt Column in report footer
=IIf((Fields!Type1.Value="R"), Sum(Fields!Amount.Value), "$0.00")
For Disbursement Column in report footer
=IIf((Fields!Type1.Value="D"), Sum(Fields!Amount.Value), "$0.00")

Same way page footer is not showing the correct value.
Instead of $257673.61, it should have been 257673.61-9340-2875.98 = $245457.63
And Disbursement column in report footer instead of $0.00 it should be $12215.98
Any Suggestions what i'm doing wrong here.


How to show correct info in dataview group footer



I think this is more of an xslt type question. Still learning more about it everyday. Just need some help or a guide to the right direction.

I've created a dataview that has grouping enabled. There's just 1 level grouping. I've enabled both "Show group header" and "Show group footer".

In the group header section, I manually inserted the following to get certain info

 <xsl:value-of select="@Cost" />

I've added the same thing in the group footer. The group header shows the correct info, but in the group footer, it shows the info of the next group header. So, I believe in the group footer, I need to enter the xslt to get info from the previous node/row. Just not sure how to put that as xslt. Would you be able to help?



Need a group total for an expression result NOT from the elements value


Simple question and still new to SSRS 2005.  Did a bit of Crystal reports before.


I have created a bit of code that returns a 0 or a 1 in a column based on a text evaluation as I could not get IIF to behave for me.  But either way the textbox displays the 0 or the 1 if the result is true.


I want to sum up the results, but I cannot seem to find the proper name for the text box to use in a =sum(textbox38) sort of statement.


So I have a couple columns like this


talked to customer estimate given      1   0

talked to customer estimate accepted   0   1


I need to count up those 0 and 1s in the footer so I know how many estimates went out and how many were accepted




how to have more than one group by clause and summation of data fields as well in group by footer!


How do we have more than one group by clause in SSRS  and summation of all fields in group by footer clause !

Is it possible to have nested group by clause in SSRS and summation of reports fields in those group by footer.

thanks in advance for your response.

Problem to group radio button across gridview rows

In general no one can easily group or make a single selection from radio button list inside gridview rows. There are a lot of way to make a single or unique selection from list. Here i want to share how i can address this problem in the most easiest way. Googling the problem most of the cases i saw the grouping in horizontal way. Thats why i tried to group the radio buttons in vertical manner. Let i have a requirement like below:


How to calculate childs age,but when i enter childs age as '03/27/2007' it returns 3 years where as actual age is 2 yr 11 months
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend