469,946 Members | 1,928 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,946 developers. It's quick & easy.

adding a "Sum Total" row to gridview?

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.
May 3 '07 #1
10 4160
"Chris G." <Ch****@discussions.microsoft.comwrote in message
news:CA**********************************@microsof t.com...
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

May 3 '07 #2
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:
"Chris G." <Ch****@discussions.microsoft.comwrote in message
news:CA**********************************@microsof t.com...
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

May 3 '07 #3
"Chris G." <Ch****@discussions.microsoft.comwrote in message
news:D0**********************************@microsof t.com...
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

May 3 '07 #4
'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:
"Chris G." <Ch****@discussions.microsoft.comwrote in message
news:D0**********************************@microsof t.com...
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

May 3 '07 #5
"Chris G." <Ch****@discussions.microsoft.comwrote in message
news:BF**********************************@microsof t.com...
'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

May 3 '07 #6
even something as simple as...
<ItemTemplate <%# Eval("Nov") %</ItemTemplate>

Breaks the page.

*sigh*

"Chris G." wrote:
'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:
"Chris G." <Ch****@discussions.microsoft.comwrote in message
news:D0**********************************@microsof t.com...
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
May 3 '07 #7
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.
May 3 '07 #8
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:
even something as simple as...
<ItemTemplate <%# Eval("Nov") %</ItemTemplate>

Breaks the page.

*sigh*

"Chris G." wrote:
'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:
"Chris G." <Chr...@discussions.microsoft.comwrote in message
>news:D0**********************************@microso ft.com...
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- Hide quoted text -

- Show quoted text -

May 3 '07 #9
"Chris G." <Ch****@discussions.microsoft.comwrote in message
news:08**********************************@microsof t.com...
>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

May 4 '07 #10
JDC
On May 3, 5:53 pm, Chris G. <Chr...@discussions.microsoft.comwrote:
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

May 4 '07 #11

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by NH | last post: by
2 posts views Thread by Nick Hodge \(MVP\) | last post: by
4 posts views Thread by MarcuEusebiu | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.