Solved

subtotal in datalist

Posted on 2004-08-11
2
484 Views
Last Modified: 2010-10-05
Does anyone know how to implement subtotals in a datalist.

Like this

            2004

                        Boeing              1

                        Milgard              3

                                    total      4
            2003

                        Boeing              2

                        Where Every      7

                                    total      9
                     
            2002

                        Boeing              7

                        etc…                1

                                    total      8

 
0
Comment
Question by:vinny45
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Accepted Solution

by:
DotNetLover_Baan earned 250 total points
ID: 11780349
I would suggest use SQL queries on the table. Like..  "SELECT SUM(Ammount) FROM SalaryTable GROUP BY Year"
-Baan
0
 
LVL 3

Assisted Solution

by:topless_stang
topless_stang earned 250 total points
ID: 11783935
I agree with Baan.  Only further thought is to combine the summary with the detail records, like:
  SELECT 0 AS TotalRow, Year,Title, Amount FROM SalaryTable
  UNION
  SELECT 1 AS TotalRow, Year,'Total' AS Title, SUM(Amount) FROM SalaryTable GROUP BY Year
  ORDER BY Year, Total, Title

I like adding a column like TotalRow for both the ORDER BY and to do things like bold the row in the output.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question