Solved

subtotal in datalist

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Add or delete table rows 10 64
How to use NFS (Network File System) in Asp.net mvc 5? 4 59
How can I do Unit Testing with Session ? 1 23
Query in AngularJS 8 49
In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

733 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