Solved

subtotal in datalist

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 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

19 Experts available now in Live!

Get 1:1 Help Now