Solved

subtotal in datalist

Posted on 2004-08-11
2
472 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Convert to Hour/minute textbox and compare 3 52
Allow space in this pattern 2 46
Vb.net dynamic formulas in runtime 11 61
Two different visual studio versions 3 21
Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

930 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now