Column Total |
1/4/2004 3:27:18 AM |
ASPRunnerPro General questions | |
M
mwill9872 author
<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=285&image=1&table=forumtopics' class='bbc_emoticon' alt=':lol:' /> Is it possible to display column total i.e. like an excel sheet |
|
![]() |
Sergey Kornilov admin 1/5/2004 |
Hi, Set rsTotals = server.CreateObject ("ADODB.Recordset")
|
![]() |
Becca 1/8/2004 |
Hi, <%   iNumberOfRows = iNumberOfRows + 1   rsData.movenext  Loop end if end sub
'Begin Column Total Code Set rsTotals = server.CreateObject ("ADODB.Recordset") strSQL = "select sum(Jan) as JanTotal, sum(Feb) as FebTotal from 2004_Nuke" rsTotals.open strSQL, dbConnection Response.Write rsTotals("JanTotal") Response.Write rsTotals("FebTotal") rsTotals.Close set rsTotals = Nothing 'End Colum Total Code
Sub CalculateOrderBy if Request.Form("action")="OrderBy" then strOrderBy = " order by " & AddWrappers(Request.Form("orderby"))
|
![]() |
Sergey Kornilov admin 1/8/2004 |
Becca, <% call WriteTableHeader call loopRs(rsDetails, CLng(PageSize)) %> <% rsDetails.Close Set rsDetails = Nothing %> </table> 'Begin Column Total Code Set rsTotals = server.CreateObject ("ADODB.Recordset") strSQL = "select sum(Jan) as JanTotal, sum(Feb) as FebTotal from 2004_Nuke" rsTotals.open strSQL, dbConnection Response.Write rsTotals("JanTotal") Response.Write rsTotals("FebTotal") rsTotals.Close set rsTotals = Nothing 'End Colum Total Code <%' Pagination: Write Control%>
|
![]() |
Becca 1/14/2004 |
I hate to be a thorn in your side with this subject, but I did exactly as the code you added says, and I cannot get totals to display on my list. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=916&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' /> Just to make sure I haven't overlooked anything, I've gathered everything together so that you can look at it a bit easier. |
![]() |
Sergey Kornilov admin 1/14/2004 |
Becca, <% call WriteTableHeader call loopRs(rsDetails, CLng(PageSize)) %> <% rsDetails.Close Set rsDetails = Nothing %> </table> 'Begin Column Total Code set dbConnection = server.CreateObject ("ADODB.Connection") dbConnection.ConnectionString = strConnection dbConnection.Open Set rsTotals = server.CreateObject ("ADODB.Recordset") strSQL = "select sum(Jan) as jant, sum(Feb) as febt, sum(Mar) as mart, sum(Apr) as aprt, sum(May) as mayt, sum(Jun) as junt, sum(Jul) as jult, sum(Aug) as augt, sum(Sep) as sept, sum(Oct) as octt, sum(Nov) as novt, sum(Dec) as dect, sum(Total) as gt from serg_test" rsTotals.open strSQL, dbConnection Response.Write rsTotals("jant") rsTotals.Close set rsTotals = Nothing dbConnection.Close set dbConnection = nothing 'End Colum Total Code <%' Pagination: Write Control%>
|
![]() |
Becca 1/14/2004 |
sweet, thanks, Serg. It works. One more question, and I'll let this topic die, promise! |
![]() |
Sergey Kornilov admin 1/14/2004 |
Becca, Response.Write FormatCurrency(rs("..."))
|