Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting column and row totals

Status
Not open for further replies.

Ken011

MIS
Oct 13, 2006
66
US
Greetings gurus.

can you please give me a sample of how I can manage the following calculates:

Please take a look at this link:


Under Capital, we have two columns, one called Def and the other called Ind.

Same holds true for Non Capital, and finally for Total

The way it works in hard copy paper is this:

Def in Capital Plus Def in Non Capital equals Def in Total.

For instance,

Capital Non Capital Total
Def
Def Def
3 2 5

Again, same holds true for Ind

Ind Ind Ind
1 2 3

So essential, we must calculate def, and ind for each row

For instance, "Bal. From Prev. Month" is one row.

We must get "Bal. From Prev. Month" for Def and Ind for Capital, Non-Capital and Total

My biggest handup is how to perform this calculation.

Does anyone have any idea how to assist, please?

Thanking you in advance
 
think i undertand the question - if you want to add
values together then it is straight forward.
[i presume your pc has iis installed and runs asp pages]
you need to rename your page criminal.asp

first put your table in a form element and 'calculate button'

Code:
<form name="criminal" id="main" action="criminal.asp" method="post">
**table in here**
<input type="submit" value="Calculate">
</form>

then heres the first rows of your table
Code:
<TABLE BORDER="1" bgcolor="#ffffff" width="100%">
     <TR>
<TH rowspan="2">&nbsp;</TH>
<TH COLSPAN=2>Capital</TH>
<TH COLSPAN=2>Non Capital</TH><TH COLSPAN=2>Total</TH>
</TR>
<TR>
<TH>DEF</TH>
<TH>IND</TH>
<TH>DEF</TH>
<TH>IND</TH>
<TH>DEF</TH>
<TH>IND</TH>
</TR>
<tr>
<TD nowrap>Bal. From Prev. Month</TD>
<TD><input type="text" size="5" name="defcap" value="<%= Server.HTMLEncode(defcap&"") %>"></TD>
<TD><input type="text" size="5" name="prevMoBal" value=""></TD> 
<TD><input type="text" size="5" name="defnocap" value="<%= Server.HTMLEncode(defnocap&"") %>"></TD>
<TD><input type="text" size="5" name="prevMoBal" value=""></TD>
<TD><%=deftot%></TD>
<TD><input type="text" size="5" name="prevMoBal" value=""></TD>
</TR>
</table>

then you need to put the following on your page
this gets the values from your text boxes and does the calulation

Code:
<%defcap = Request.Form("defcap")
defcap = CCur(defcap)
defnocap = Request.Form("defnocap")
defnocap = CCur(defnocap)
deftot = (defcap + defnocap)
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top