how do display the total salary(down xyz goup, lmn group) in
jsp?
eg: cash noncash
xyz 12 15
13 17
15 10
------------------
total: 40 42
lmn 10 20
21 30
5 7
----------------------
total: 35 57
for total i written the query select sum(cash)as cash sum(noncash) as noncash from table, it retuned the total list of values in action class, i am able to get the values in action class but in jsp i am not able to print the total values.
i am using
struts, i am able to print the list of people in jsp, but how to disply the total value after the xyz group, lmn group.
the code i am using jsp page is;
bean:write name="payment" property="totalcashamt" /></td>
<bean:write name="payment" property="totalnoncashamt" />
Action class:
ArrayList totalcash=new ArrayList();
totalcash=paylist.getTotalcash(con, fname,lname,city);
DAO:
SELECT SUM(CASH_AMT) AS TOTALCASHAMT, SUM(NON_CASH_AMT) AS TOTALNONCASHAMT FROM DM_HD where firstname='' or lastname=''' city="" group by Entity_paid_src_id ORDER BY FRST_NM ASC