Connecting Tech Pros Worldwide Help | Site Map

adding a "Sum Total" row to gridview?

=?Utf-8?B?Q2hyaXMgRy4=?=
Guest
 
Posts: n/a
#1: May 3 '07
How would I output a row for the Computed sums? I just want to append it as
a row at the bottom of my gridview table.
Mark Rae
Guest
 
Posts: n/a
#2: May 3 '07

re: adding a "Sum Total" row to gridview?


"Chris G." <ChrisG@discussions.microsoft.comwrote in message
news:CA6D84D7-E055-409D-9A1C-03C901CA4404@microsoft.com...
Quote:
How would I output a row for the Computed sums? I just want to append it
as
a row at the bottom of my gridview table.
http://www.google.co.uk/search?sourc...iew+totals+row


--
http://www.markrae.net

=?Utf-8?B?Q2hyaXMgRy4=?=
Guest
 
Posts: n/a
#3: May 3 '07

re: adding a "Sum Total" row to gridview?


Thanks for the google search, but that's the first thing I tried. I'm using
'Compute' in my query which generates a row for computed sums. I was hoping
to use these values as, due to security reasons, I'm not allowed to place
code blocks on or behind the page.


"Mark Rae" wrote:
Quote:
"Chris G." <ChrisG@discussions.microsoft.comwrote in message
news:CA6D84D7-E055-409D-9A1C-03C901CA4404@microsoft.com...
>
Quote:
How would I output a row for the Computed sums? I just want to append it
as
a row at the bottom of my gridview table.
>
http://www.google.co.uk/search?sourc...iew+totals+row
>
>
--
http://www.markrae.net
>
>
Mark Rae
Guest
 
Posts: n/a
#4: May 3 '07

re: adding a "Sum Total" row to gridview?


"Chris G." <ChrisG@discussions.microsoft.comwrote in message
news:D0BB41FA-B063-4029-849A-150CB7900D9C@microsoft.com...
Quote:
due to security reasons, I'm not allowed to place code blocks on or behind
the page.
??? You can't possibly be serious...!


--
http://www.markrae.net

=?Utf-8?B?Q2hyaXMgRy4=?=
Guest
 
Posts: n/a
#5: May 3 '07

re: adding a "Sum Total" row to gridview?


'Fraid so. Working in a SharePoint environment that won't let me put code
blocks on the page. I can only use asp.net controls. And even then, I'm
limited. Suck to be me. but my hands are tied. That's why I'm trying to do
it all with SQL and controls.

I'm trying to find what I can get away with as far as customization, but
it's a tedious process.

CG

"Mark Rae" wrote:
Quote:
"Chris G." <ChrisG@discussions.microsoft.comwrote in message
news:D0BB41FA-B063-4029-849A-150CB7900D9C@microsoft.com...
>
Quote:
due to security reasons, I'm not allowed to place code blocks on or behind
the page.
>
??? You can't possibly be serious...!
>
>
--
http://www.markrae.net
>
>
Mark Rae
Guest
 
Posts: n/a
#6: May 3 '07

re: adding a "Sum Total" row to gridview?


"Chris G." <ChrisG@discussions.microsoft.comwrote in message
news:BFD0171F-A7C1-46FC-9D06-12DAFDFEB27A@microsoft.com...
Quote:
'Fraid so. Working in a SharePoint environment that won't let me put code
blocks on the page. I can only use asp.net controls. And even then, I'm
limited. Suck to be me. but my hands are tied. That's why I'm trying to
do
it all with SQL and controls.
Time to find another job...

I just can't imagine that sort of environment - how can you ever get
anything done...?


--
http://www.markrae.net

=?Utf-8?B?Q2hyaXMgRy4=?=
Guest
 
Posts: n/a
#7: May 3 '07

re: adding a "Sum Total" row to gridview?


even something as simple as...
<ItemTemplate <%# Eval("Nov") %</ItemTemplate>

Breaks the page.

*sigh*

"Chris G." wrote:
Quote:
'Fraid so. Working in a SharePoint environment that won't let me put code
blocks on the page. I can only use asp.net controls. And even then, I'm
limited. Suck to be me. but my hands are tied. That's why I'm trying to do
it all with SQL and controls.
>
I'm trying to find what I can get away with as far as customization, but
it's a tedious process.
>
CG
>
"Mark Rae" wrote:
>
Quote:
"Chris G." <ChrisG@discussions.microsoft.comwrote in message
news:D0BB41FA-B063-4029-849A-150CB7900D9C@microsoft.com...
Quote:
due to security reasons, I'm not allowed to place code blocks on or behind
the page.
??? You can't possibly be serious...!


--
http://www.markrae.net
=?Utf-8?B?Q2hyaXMgRy4=?=
Guest
 
Posts: n/a
#8: May 3 '07

re: adding a "Sum Total" row to gridview?


Time to find another job...
Quote:
I just can't imagine that sort of environment - how can you ever get
anything done...?
You can't. but that doesn't stop them from asking for more.
carion1
Guest
 
Posts: n/a
#9: May 3 '07

re: adding a "Sum Total" row to gridview?


Dump all the data into a temp table (make sure you add an identity
column) and then throw in your summation. Pull it out ordering by the
identity column on the temp table. Thats a dirty solution but it will
work.

Derek

On May 3, 11:43 am, Chris G. <Chr...@discussions.microsoft.comwrote:
Quote:
even something as simple as...
<ItemTemplate <%# Eval("Nov") %</ItemTemplate>
>
Breaks the page.
>
*sigh*
>
>
>
"Chris G." wrote:
Quote:
'Fraid so. Working in a SharePoint environment that won't let me put code
blocks on the page. I can only use asp.net controls. And even then, I'm
limited. Suck to be me. but my hands are tied. That's why I'm trying to do
it all with SQL and controls.
>
Quote:
I'm trying to find what I can get away with as far as customization, but
it's a tedious process.
>
Quote:
CG
>
Quote:
"Mark Rae" wrote:
>
Quote:
Quote:
"Chris G." <Chr...@discussions.microsoft.comwrote in message
>news:D0BB41FA-B063-4029-849A-150CB7900D9C@microsoft.com...
>
Quote:
Quote:
due to security reasons, I'm not allowed to place code blocks on or behind
the page.
>
Quote:
Quote:
??? You can't possibly be serious...!
>
Quote:
Quote:
--
>http://www.markrae.net- Hide quoted text -
>
- Show quoted text -

Mark Rae
Guest
 
Posts: n/a
#10: May 4 '07

re: adding a "Sum Total" row to gridview?


"Chris G." <ChrisG@discussions.microsoft.comwrote in message
news:08A0BE3E-4269-48AD-8B77-040D4D9D3788@microsoft.com...
Quote:
Quote:
>I just can't imagine that sort of environment - how can you ever get
>anything done...?
>
You can't. but that doesn't stop them from asking for more.
Why do you put up with it...?


--
http://www.markrae.net

JDC
Guest
 
Posts: n/a
#11: May 4 '07

re: adding a "Sum Total" row to gridview?


On May 3, 5:53 pm, Chris G. <Chr...@discussions.microsoft.comwrote:
Quote:
Quote:
Time to find another job...
I just can't imagine that sort of environment - how can you ever get
anything done...?
>
You can't. but that doesn't stop them from asking for more.
Wow. I think Confucious said "First find people you can trust. And
then trust them". It must be horrible to be a developer in an
environment that doesn't trust developers.

Anyway, my solution would be similar to the "temp table" suggestion.
You'll probably have to do your summation it in SQL, so I'd suggest a
union query which would give you the total row at the bottom. Without
any code it's going to be hard to apply a different CSS class to style
the totals differently, but hey...

SELECT MyDate, ProductCode, Amount
FROM tb_sales

UNION ALL
SELECT NULL AS myDate, NULL AS ProductCode, SUM(Amount)
FROM tb_sales

Something like that, anyway.

HTH





Closed Thread