Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Show total of each column

 
jayalakshmi charugundla
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

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
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jayalakshmi charugundla wrote:It's urgent

Please EaseUp and UseAMeaningfulSubjectLine. I've changed the title of your post.
 
xsunil kumar
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

-Sunil
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic