This is a forum where members new and old can come to ask questions and get info and opinions. It is not a place to advertise your business or have other forms of advertising, whether it be in your posts or signature.

All links in the forum will not be indexed by Search Engines and any unapproved forms of advertising or spam will be dealt with accordingly, deleted, and that member's account banned.

Forums

Overview » Ajax & JavaScript » Total in jsp
Reply

Total in jsp

connie princess
Member



Since: 01 Aug 2008
Posts: 1
Posted 01 Aug 2008 16:50:15

Hii
I am new to java scripting, I have a query that gives me a number of rows and have tabulated results in the following table;But I cant get the totals for the column total_tax_amount which is the sum of amount in the query.

<table width="90%" border="1" align="center" cellpadding="0" cellspacing="0">
<%-- define a variable for total taxes--%>
<c:set var="totaltaxes" value="0"/>

<%-- Get the column names for the header of the table --%>

<c:forEach var="columnName" items="${sad_doc_rs.columnNames}">
&lt;th&gt;&lt;c<img src=../images/dmxzone/forum/icon_smile_shock.gif border=0 align=middle>ut value="${columnName}"/&gt;&lt;/th&gt;
&lt;/c:forEach&gt;

&lt;%-- Get the value of each column while iterating over rows --%&gt;

&lt;c:forEach var="row" items="${sad_doc_rs.rows}"&gt;
&lt;c:set var="t-taxes" value="${((row.total_tax_amount))}"/&gt;

&lt;c:set var="totaltaxes" value="${totaltaxes+t-taxes}"/&gt;
&lt;tr&gt;

&lt;c:forEach var="column" items="${row}"&gt;
&lt;td&gt;&lt;c<img src=../images/dmxzone/forum/icon_smile_shock.gif border=0 align=middle>ut value="${column.value}"/&gt;&lt;/td&gt;

&lt;/c:forEach&gt;
&lt;/tr&gt;
&lt;/c:forEach&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td colspan="2"&gt;&lt;strong&gt;TOTALS&lt;/strong&gt;&lt;/td&gt;
&lt;td width="34%"&gt;&lt;c<img src=../images/dmxzone/forum/icon_smile_shock.gif border=0 align=middle>ut value="${totaltaxes}"/&gt;&lt;/td&gt;

&lt;/tr&gt;
&lt;/table&gt;


Hii
I am new to java scripting, I have a query that gives me a number of rows and have tabulated results in the following table;But I cant get the totals for the column total_tax_amount which is the sum of amount in the query.

&lt;table width="90%" border="1" align="center" cellpadding="0" cellspacing="0"&gt;
&lt;%-- define a variable for total taxes--%&gt;
&lt;c:set var="totaltaxes" value="0"/&gt;

&lt;%-- Get the column names for the header of the table --%&gt;

&lt;c:forEach var="columnName" items="${sad_doc_rs.columnNames}"&gt;
&lt;th&gt;&lt;c<img src=../images/dmxzone/forum/icon_smile_shock.gif border=0 align=middle>ut value="${columnName}"/&gt;&lt;/th&gt;
&lt;/c:forEach&gt;

&lt;%-- Get the value of each column while iterating over rows --%&gt;

&lt;c:forEach var="row" items="${sad_doc_rs.rows}"&gt;
&lt;c:set var="t-taxes" value="${((row.total_tax_amount))}"/&gt;

&lt;c:set var="totaltaxes" value="${totaltaxes+t-taxes}"/&gt;
&lt;tr&gt;

&lt;c:forEach var="column" items="${row}"&gt;
&lt;td&gt;&lt;c<img src=../images/dmxzone/forum/icon_smile_shock.gif border=0 align=middle>ut value="${column.value}"/&gt;&lt;/td&gt;

&lt;/c:forEach&gt;
&lt;/tr&gt;
&lt;/c:forEach&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td colspan="2"&gt;&lt;strong&gt;TOTALS&lt;/strong&gt;&lt;/td&gt;
&lt;td width="34%"&gt;&lt;c<img src=../images/dmxzone/forum/icon_smile_shock.gif border=0 align=middle>ut value="${totaltaxes}"/&gt;&lt;/td&gt;

&lt;/tr&gt;
&lt;/table&gt;


Reply to this topic

Message
Reply
Follow us on Facebook Follow us on twitter Subscribe to the RSS feed
Activate your free membership today | Login | Currency