• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Show total of each column

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

jayalakshmi charugundla wrote:It's urgent


Please EaseUp and UseAMeaningfulSubjectLine. I've changed the title of your post.
 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic