adding a "Sum Total" row to gridview?

G

Guest

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.
 
G

Guest

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.
 
G

Guest

'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
 
G

Guest

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

Breaks the page.

*sigh*
 
M

Mark Rae

'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...?
 
G

Guest

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.
 
C

carion1

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
 
J

JDC

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top