A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Take Control of Upgrading to Yosemite
Take Control of Automating Your Mac
this week in the
Show total of each column
Joined: Jul 22, 2009
May 31, 2010 05:49:00
I have created one jsp page.In that page i got the data by calling procedure
Here I dont know how to do column of the sum?
The values are coming from the database through procedure.
How to do the total for each column?which logic i have to implement?
Application Status Report
status a1 a2 a3 a4
EAI Account Error -1 3 3 7
EAI Account Error -2 3 5 1
EAI Account Error -3 1 3 1
EAI Account Error -5 1 4 9
Grand Total -11 8 15 18
Joined: Nov 24, 2005
May 31, 2010 06:03:14
jayalakshmi charugundla wrote:
. I've changed the title of your post.
All roads lead to JavaRanch
Joined: Dec 14, 2009
May 31, 2010 06:18:03
Jaya, i am assuming that your data is coming in loop from the database. So for getting total of any column of data, just define one varaible outside of the loop. For example :-
double sum = 0.0 ;
Now inside the loop.
sum = sum+<amount>
Now just print the value of sum outside the loop.
Hope this will solve your problem.
subject: Show total of each column
column heading dates ...
Use of Display tags
Hibernate and MySQL Views
Can you suggest the best solution for the given scenario?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014