473,490 Members | 2,737 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Step-thru code - odd behavior

I have a breakpoint in an aspx page that I'm using to try to trap some code
to see what's going on. I'm translating a page that is working in a
traditional ASP page, which takes several session variables, formats a
header, and assigns a sql stored procedure to be run and a report generated
in a web browser.
The odd behavior occurs where I have my breakpoint, which is at the place
where the variable "showblank" is set to = " ". It'll hit the next
couple of lines, then skip down into the middle of the if rstemp.EOF code -
like on the second response.write.

It then skips all over the place within the code, in the middle of if
statements, then on down thru the script at the bottom of the page. It
eventually gives me the error:

"Server Error in '/test' Application.
----------------------------------------------------------------------------
----
Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set
to an instance of an object.

Source Error:

[No relevant source lines]
Source File: c:\inetpub\wwwroot\test\sales\reportASP.aspx Line: 409

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an
object.]

ASP.reportasp_aspx.__Render__control1(HtmlTextWrit er __output, Control
parameterContainer) in c:\inetpub\wwwroot\test\sales\reportASP.aspx:409

System.Web.UI.Control.RenderChildren(HtmlTextWrite r
writer)System.Web.UI.Control.Render(HtmlTextWriter writer)

System.Web.UI.Control.RenderControl(HtmlTextWriter writer)

System.Web.UI.Page.ProcessRequestMain()

----------------------------------------------------------------------------
----

Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
Version:1.1.4322.573 "

What appears to happen to generate the error is that it skips beyond the end
of the .aspx page.

The parameter files are pieces that were originally Include files that were
supposed to be called when it was run, but I pulled them into the
codebehind. They basically are if statements that set several session
variables that control what stored procedure is run and information we put
on the header of the report page.

I'm lost as to why it skips around like it does. I have several asp pages
in front of this one that have been converted, and they all seem to follow
thru a logical step through, but not this one.

Any advice/help appreciated.

SC

The code follows:

<%@ Page language="vb" src="ReportASP.aspx.vb"
Inherits="reportASP.ReportASP_aspx_vb" Codebehind="reportasp.aspx.vb"
Debug="true" %>
<%@ Import Namespace = "nce.vbscript" %>
<!--#include file="reportheader.inc"-->
<% Exceptions() %>
<!-------------------------------------------------------------------->
<%

SetSaveAsName()

%>
<html>

<head>
<title>My Website Report</title>
</head>

<body link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF" topmargin="1">

<table border="0" width="100%">
<tr>
<td width="100%"><p align="center"><!--#include
file="remheader4d.inc"--> </td>
</tr>
<tr>
<%
FormatReportHeader()

%>

<%
If Ammospool = "" Then
If Session("rpt").ToString() = "QW" Then %>
<td width="100%"><p align="center"><font
color="#000000"><strong><small>Report:&nbsp; </small><%=
Session("RptJnumber") & " " & Session("rptYear") & " " & Session("Select") &
" " & AmmoSelect & " " & Session("ammo") & " " & Session("ranking")
%><small>
<%
Else %>
<td width="100%"><p align="center"><font
color="#000000"><strong><small>Report:&nbsp; </small><%=
Session("RptJnumber") & " " & Session("rptYear") & " Year " &
Session("Select") & " " & AmmoSelect & " " & Session("ammo") & " " &
Session("ranking") %><small>
<% End IF
Else %>
</small></strong></font></td>
<%
If Session("rpt").ToString() = "TAR" Or Session("rpt").ToString() =
"MBM" Then
%>
<td width="100%"><p align="center"><font
color="#000000"><strong><small>Report:&nbsp; </small><%=
Session("RptJnumber") & " " & Session("rptYear") & " Year " &
Session("Select") & " " & " " & Session("ranking") %><small>
<% Else
If Session("select").ToString() = "J7QSUM" Or
Session("select").ToString() = "J7QDETAIL" Or Session("select").ToString() =
"J7QSINGLE" Or Session("select").ToString() = "J7QSKU" Then
%>
<td width="100%"><p align="center"><font
color="#000000"><strong><small>Report:&nbsp; </small><%=
Session("RptJnumber") & " " & Session("rptYear") & " Year " &
Session("ranking") %><small>
<% Else %>
<td width="100%"><p align="center"><font
color="#000000"><strong><small>Report:&nbsp; </small><%=
Session("RptJnumber") & " " & Session("rptYear") & " Year " &
Session("Select") & " " & Ammospool & " " & Session("ranking") %><small>
<% End IF
End IF
End IF
%>
</small></strong></font></td>
</tr>
<tr>
<td width="100%"><p align="center"><font color="#000000"><small>Last
Updated: <%= __when %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Report Date:&nbsp;</small> <small><%= Today()
%></small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Report
Time:&nbsp;<%= TimeOfDay() %></small> <big><strong>&nbsp;</strong></big>
&nbsp;</font></td>
</tr>
<% SessionParameters() %>
<tr>
<td width="100%"><small><p align="center"><font color="#000000"><b>(
Selection: <%= Session("Selection") & " " & Session("POs")
%>)</b></font></small></td>
</tr>
</table>

<% J3Parameters() %>
<% J4Parameters() %>
<% J5Parameters() %>
<% J6Parameters() %>
<% J7Parameters() %>
<% J9Parameters() %>
<% I1Parameters() %>
<% rebateparameters() %>
<% springparameters() %>
<% qualificationparameters() %>
<% coopparameters() %>
<% specialreports() %>

<%

showblank = "&nbsp;"
shownull = "-null-"
conntemp = new ADODB.Connection()
conntemp.connectionstring = session("serverstring")
'conntemp.connectiontimeout = 900 ' (Add This line)
conntemp.CommandTimeout = 2000
Server.ScriptTimeout = 2000
Session.Add("rptstart", Timer())
conntemp.Open()
rstemp = conntemp.Execute(mySQL)
If rstemp.EOF Then
Response.Write("<b>No records matched<br>")
Response.Write(mySQL & "<br>So cannot make table...</b>")
conntemp.Close()
conntemp = Nothing
Response.End()
End IF
If Session("user").ToString() = "CHATHAMSC" Then
Response.Write(mySQL)
'for each strkey in session.contents
'response.write "(" & Session.contents.key(strkey) & ") " &
session.contents.item(strkey)& "<BR>"
'next
'' for each strkey in session.contents
'' if session.contents.item(strkey) <> "" then
'' response.write "(" & Session.contents.key(strkey) & ") " &
session.contents.item(strkey)& "<BR>"
'' end if
'' next
End IF
%>

<%
If (Session("Year").ToString() = "Sales" Or Session("Year").ToString() =
"Calendar") AND ((Session("Select").ToString() = "Material Number" AND
Session("matdesc").ToString() <> "") Or (Session("rpt").ToString() = "J6"
AND Session("select").ToString() = "Detail") Or (Session("rpt").ToString() =
"J5" AND Session("select").ToString() = "Detail")) Or
(Session("rpt").ToString() = "QD" Or Session("rpt").ToString() = "QW" Or
Session("rpt").ToString() = "MBM") Then
%>

<table border="9" align="center"
style="font-family: Arial; font-size: 8pt; border: medium none"
bordercolor="#000000">
<%
Else
%>

<tr>
<td><table border="9" align="center"
style="font-family: Arial; font-size: 9pt; border: medium none"
bordercolor="#000000">
<%
End IF
%>

<tr>
<%
'Put Headings On The Table of Field Names
'redim sData(rs.recordcount,175)
rownumber = 3
colnumber = 0
BeenThere = 0
lcnt = 0
numcols = 0
actualcols = 0
NrGroups = 0
For Each WhatCol In rstemp.Fields
If Len(WhatCol.Name) <> 1 Then
thisfield = WhatCol.Name
GroupField(lcnt) = 0
numcols = numcols + 1
%>

<td bgcolor="#FFFFFF" align="center"><p align="center"><font
color="#000000"><b><%= thisfield %></b></font></td>
<%
Else
'All 1 Character Field Names are Grouping Fields
'This sets up the grouping with hierachy determined from left to
right in SQL
GroupField(lcnt) = 1
NrGroups = NrGroups + 1
End IF
actualcols = actualcols + 1
lcnt = lcnt + 1
Next
TBorder = "border:medium none "
'TBorder = "border-left: medium none; border-right: medium none;
border-top: medium double; border-bottom: medium none"
%>

</tr>
<%
'Now lets grab all the records
rownumber = 3
bgcolor = "white"
Do Until rstemp.EOF
%>

<tr>
<%
lcnt = 0
'Prepare Row for Printing
For Each WhatCol In rstemp.Fields
'Load data to array
sData(rownumber, lcnt) = WhatCol.Value
'If Data Type is currency, real or float
'response.write "QQ" & whatcol.type & "ZZ"
'response.write "name = " & whatcol.name
If WhatCol.Type = 6 Or WhatCol.Type = 5 Then
GrandTotal(lcnt + 1, 0) = GrandTotal(lcnt + 1, 0) +
WhatCol.Value
End IF
'Suppress Duplicates for Printing
'Set up the first row for Grouping
If rownumber = 3 Then
sData(rownumber - 1, lcnt) = WhatCol.Value
End IF
If (sData(rownumber, lcnt) = sData(rownumber - 1, lcnt)) AND
(WhatCol.Type <> 5 AND WhatCol.Type <> 6) Then
If rownumber = 3 Then
thisfield = WhatCol.Value
GroupField(lcnt) = GroupField(lcnt) + 1
Else
'Added the linecount < NrGroups times 2 which not
suppress duplicates on any field except Group Fields
'If you need to change it back insert (thisfield =
showblank) in place of If Statement.
If lcnt < (NrGroups * 2) + 1 Then
thisfield = showblank
GroupField(lcnt) = GroupField(lcnt) + 1
Else
thisfield = WhatCol.Value
End IF
End IF
Else
thisfield = sData(rownumber, lcnt)
GroupField(lcnt) = 0
End IF
'Total Rows Field Length is 1 Character
If Len(WhatCol.Name) <> 1 Then
If WhatCol.Type = 6 Or WhatCol.Type = 5 Then
thisfield = FormatNumber(CDbl(thisfield), 0)
End IF
%>

<td bgcolor="<%= bgcolor %>" valign="top" align="right"
style="border: medium none"><%= thisfield %>
<%
End IF
lcnt = lcnt + 1
Next
rstemp.MoveNext()
'set or reset data
ralign = "right"
'Change colors for every other line
If chgcolor = 0 Then
bgcolor = "#FFFFCC"
chgcolor = 1
Else
bgcolor = "White"
chgcolor = 0
End IF
'End Totals and Grouping
lcnt = 0
If Not rstemp.EOF Then
For Each WhatCol In rstemp.Fields
If Len(WhatCol.Name) = 1 Then
If WhatCol.Value.ToString() <> CStr(sData(rownumber,
lcnt)) Then
PrintTotal(lcnt) = lcnt
GroupField(lcnt) = 1
Else
'if rownumber<>3 then
rowCnt(lcnt) = rowCnt(lcnt) + 1
'end if
GroupField(lcnt) = 0
End IF
lcnt = lcnt + 1
End IF
Next
End IF
If rstemp.EOF Then
lcnt = 0
For Each WhatCol In rstemp.Fields
If Len(WhatCol.Name) = 1 Then
If sData(rownumber - 1, lcnt) = sData(rownumber, lcnt)
AND CStr(sData(rownumber, lcnt)) <> "" Then
PrintTotal(lcnt) = lcnt
GroupField(lcnt) = 1
'rowcnt(lcnt) = rowcnt(lcnt)+1
Else
PrintTotal(lcnt) = NrGroups + 1
'if rownumber<>3 then
rowCnt(lcnt) = 0
'end if
GroupField(lcnt) = 0
End IF
'lcnt = lcnt + 1
End IF
lcnt = lcnt + 1
Next
End IF
lcnt = 0
iGroup = 0
For tcnt = 0 To NrGroups
pcnt = NrGroups - tcnt
If CInt(PrintTotal(pcnt)) < NrGroups AND (CInt(GroupField(pcnt))
= 1 AND CInt(rowCnt(pcnt)) > 0) Then
GroupField(pcnt) = 0
'rowcnt(pcnt) = 0
If CInt(rowCnt(pcnt)) > 0 Then
Response.Write("</tr><tr>")
End IF
For Each WhatCol In rstemp.Fields
If Len(WhatCol.Name) <> 1 Then
If CInt(rowCnt(pcnt)) < 1 AND (WhatCol.Type = 5 AND
WhatCol.Type = 6) Then
GrpTotal(lcnt, PrintTotal(pcnt)) = 0
End IF
If Len(WhatCol.Name) <> 1 AND (WhatCol.Type <> 5 AND
WhatCol.Type <> 6) Then
If lcnt = CInt((NrGroups) + PrintTotal(pcnt))
Then
sTotals = CStr(sData(rownumber, lcnt))
'& "-" & rowcnt(pcnt) & WHATCOL.TYPE
Else
sTotals = showblank
End IF
If CInt(rowCnt(pcnt)) > 0 Then
Response.Write("<TD style=" & TBorder & "
ALIGN=" & ralign & " BGCOLOR=" & bgcolor & "><STRONG>" & sTotals &
"</FONT></STRONG></TD>")
End IF
End IF
If Len(WhatCol.Name) <> 1 AND (WhatCol.Type = 5 Or
WhatCol.Type = 6) Then
For colcount = 0 To rowCnt(pcnt)
atotals = sData(rownumber - colcount, lcnt)
+ atotals
Next
atotals = FormatNumber(CDbl(atotals), 0)
If CInt(rowCnt(pcnt)) > 0 Then
Response.Write("<TD style=" & TBorder & "
ALIGN=" & ralign & " BGCOLOR=" & bgcolor & "><STRONG>" & atotals &
"</FONT></STRONG></TD>")
End IF
GrpTotal(lcnt, PrintTotal(pcnt)) = 0
atotals = 0
End IF
End IF
lcnt = lcnt + 1
Next
If CInt(rowCnt(pcnt)) > 0 Then
Response.Write("</tr><tr>")
BeenThere = BeenThere + 1
End IF
rowCnt(pcnt) = 0
'Change colors for every other line
If chgcolor = 0 Then
bgcolor = "#FFFFCC"
chgcolor = 1
Else
bgcolor = "White"
chgcolor = 0
End IF
End IF
lcnt = 0
Next
rownumber = rownumber + 1
Loop
%>

</td>
</tr>
<tr>
<%
'Grand Total Routine
lcnt = 0
col1 = 0
If NrGroups > 0 Then
'If any 1 character fields where defined, Grand Totals will appear
For Each WhatCol In rstemp.Fields
If WhatCol.Type = 6 Or WhatCol.Type = 5 Then
sTotal = FormatNumber(CDbl(GrandTotal(lcnt + 1, 0)), 0)
%>

<td bgcolor="<%= bgcolor %>" valign="top" align="right"
style="border-left: medium none; border-right: medium none;
border-top: medium double; border-bottom: medium none"><strong><%= (sTotal)
%></strong>
<%
sTotal = 0
Else
If Len(WhatCol.Name) <> 1 Then
If col1 = 0 Then
sTotal1 = "Grand Total"
col1 = 1
Else
sTotal1 = showblank
End IF
Else
sTotal1 = showblank
End IF
If Len(WhatCol.Name) <> 1 Then
%>
</td>
<td bgcolor="<%= bgcolor %>" valign="top" align="right"
style="border-left: medium none; border-right: medium none;
border-top: medium double; border-bottom: medium none"><strong><%= sTotal1
%></strong>
<%
End IF
End IF
lcnt = lcnt + 1
Next
%>
</td>
</tr>
<%
End IF
Session.Add("rptend", Timer())
Session.Add("rpttime", FormatNumber(CDbl(Session("rptend")) -
CDbl(Session("rptstart")), 1))
rstemp.Close()
rstemp = Nothing
conntemp.Close()
conntemp = Nothing
%>

</table>
<p><small><%
Response.Write("The report ran in " & Session("rpttime") & " second(s)")
%>
</small></td>
</tr>
</table>
<!-------------------------------------------------------------------->

</body>
<script LANGUAGE="VBSCRIPT">
<!--
sub window_onload
updatestatus
end sub
Sub UpdateStatus
Status = "<%= mySQL %>"
end sub

-->
</script>

</html>
Nov 18 '05 #1
2 1717
delete the dll & pdb file in bin folder and rebuild your solution.

--
------------------------------------
Make Unlimited phone calls from your PC to ANY phone in the World!
http://www.eboom.com/free/
<me@privacy.net> wrote in message
news:#b*************@TK2MSFTNGP11.phx.gbl...
I have a breakpoint in an aspx page that I'm using to try to trap some code to see what's going on. I'm translating a page that is working in a
traditional ASP page, which takes several session variables, formats a
header, and assigns a sql stored procedure to be run and a report generated in a web browser.
The odd behavior occurs where I have my breakpoint, which is at the place
where the variable "showblank" is set to = "&nbsp;". It'll hit the next
couple of lines, then skip down into the middle of the if rstemp.EOF code - like on the second response.write.

It then skips all over the place within the code, in the middle of if
statements, then on down thru the script at the bottom of the page. It
eventually gives me the error:

"Server Error in '/test' Application.
-------------------------------------------------------------------------- -- ----
Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set
to an instance of an object.

Source Error:

[No relevant source lines]
Source File: c:\inetpub\wwwroot\test\sales\reportASP.aspx Line: 409

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an
object.]

ASP.reportasp_aspx.__Render__control1(HtmlTextWrit er __output, Control
parameterContainer) in c:\inetpub\wwwroot\test\sales\reportASP.aspx:409

System.Web.UI.Control.RenderChildren(HtmlTextWrite r
writer)System.Web.UI.Control.Render(HtmlTextWriter writer)

System.Web.UI.Control.RenderControl(HtmlTextWriter writer)

System.Web.UI.Page.ProcessRequestMain()

-------------------------------------------------------------------------- -- ----

Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573 "

What appears to happen to generate the error is that it skips beyond the end of the .aspx page.

The parameter files are pieces that were originally Include files that were supposed to be called when it was run, but I pulled them into the
codebehind. They basically are if statements that set several session
variables that control what stored procedure is run and information we put
on the header of the report page.

I'm lost as to why it skips around like it does. I have several asp pages
in front of this one that have been converted, and they all seem to follow
thru a logical step through, but not this one.

Any advice/help appreciated.

SC

The code follows:

<%@ Page language="vb" src="ReportASP.aspx.vb"
Inherits="reportASP.ReportASP_aspx_vb" Codebehind="reportasp.aspx.vb"
Debug="true" %>
<%@ Import Namespace = "nce.vbscript" %>
<!--#include file="reportheader.inc"-->
<% Exceptions() %>
<!-------------------------------------------------------------------->
<%

SetSaveAsName()

%>
<html>

<head>
<title>My Website Report</title>
</head>

<body link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF" topmargin="1">

<table border="0" width="100%">
<tr>
<td width="100%"><p align="center"><!--#include
file="remheader4d.inc"--> </td>
</tr>
<tr>
<%
FormatReportHeader()

%>

<%
If Ammospool = "" Then
If Session("rpt").ToString() = "QW" Then %>
<td width="100%"><p align="center"><font
color="#000000"><strong><small>Report:&nbsp; </small><%=
Session("RptJnumber") & " " & Session("rptYear") & " " & Session("Select") & " " & AmmoSelect & " " & Session("ammo") & " " & Session("ranking")
%><small>
<%
Else %>
<td width="100%"><p align="center"><font
color="#000000"><strong><small>Report:&nbsp; </small><%=
Session("RptJnumber") & " " & Session("rptYear") & " Year " &
Session("Select") & " " & AmmoSelect & " " & Session("ammo") & " " &
Session("ranking") %><small>
<% End IF
Else %>
</small></strong></font></td>
<%
If Session("rpt").ToString() = "TAR" Or Session("rpt").ToString() = "MBM" Then
%>
<td width="100%"><p align="center"><font
color="#000000"><strong><small>Report:&nbsp; </small><%=
Session("RptJnumber") & " " & Session("rptYear") & " Year " &
Session("Select") & " " & " " & Session("ranking") %><small>
<% Else
If Session("select").ToString() = "J7QSUM" Or
Session("select").ToString() = "J7QDETAIL" Or Session("select").ToString() = "J7QSINGLE" Or Session("select").ToString() = "J7QSKU" Then
%>
<td width="100%"><p align="center"><font
color="#000000"><strong><small>Report:&nbsp; </small><%=
Session("RptJnumber") & " " & Session("rptYear") & " Year " &
Session("ranking") %><small>
<% Else %>
<td width="100%"><p align="center"><font
color="#000000"><strong><small>Report:&nbsp; </small><%=
Session("RptJnumber") & " " & Session("rptYear") & " Year " &
Session("Select") & " " & Ammospool & " " & Session("ranking") %><small>
<% End IF
End IF
End IF
%>
</small></strong></font></td>
</tr>
<tr>
<td width="100%"><p align="center"><font color="#000000"><small>Last
Updated: <%= __when %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Report Date:&nbsp;</small> <small><%= Today()
%></small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Report
Time:&nbsp;<%= TimeOfDay() %></small> <big><strong>&nbsp;</strong></big> &nbsp;</font></td>
</tr>
<% SessionParameters() %>
<tr>
<td width="100%"><small><p align="center"><font color="#000000"><b>(
Selection: <%= Session("Selection") & " " & Session("POs")
%>)</b></font></small></td>
</tr>
</table>

<% J3Parameters() %>
<% J4Parameters() %>
<% J5Parameters() %>
<% J6Parameters() %>
<% J7Parameters() %>
<% J9Parameters() %>
<% I1Parameters() %>
<% rebateparameters() %>
<% springparameters() %>
<% qualificationparameters() %>
<% coopparameters() %>
<% specialreports() %>

<%

showblank = "&nbsp;"
shownull = "-null-"
conntemp = new ADODB.Connection()
conntemp.connectionstring = session("serverstring")
'conntemp.connectiontimeout = 900 ' (Add This line)
conntemp.CommandTimeout = 2000
Server.ScriptTimeout = 2000
Session.Add("rptstart", Timer())
conntemp.Open()
rstemp = conntemp.Execute(mySQL)
If rstemp.EOF Then
Response.Write("<b>No records matched<br>")
Response.Write(mySQL & "<br>So cannot make table...</b>")
conntemp.Close()
conntemp = Nothing
Response.End()
End IF
If Session("user").ToString() = "CHATHAMSC" Then
Response.Write(mySQL)
'for each strkey in session.contents
'response.write "(" & Session.contents.key(strkey) & ") " &
session.contents.item(strkey)& "<BR>"
'next
'' for each strkey in session.contents
'' if session.contents.item(strkey) <> "" then
'' response.write "(" & Session.contents.key(strkey) & ") " &
session.contents.item(strkey)& "<BR>"
'' end if
'' next
End IF
%>

<%
If (Session("Year").ToString() = "Sales" Or Session("Year").ToString() = "Calendar") AND ((Session("Select").ToString() = "Material Number" AND
Session("matdesc").ToString() <> "") Or (Session("rpt").ToString() = "J6"
AND Session("select").ToString() = "Detail") Or (Session("rpt").ToString() = "J5" AND Session("select").ToString() = "Detail")) Or
(Session("rpt").ToString() = "QD" Or Session("rpt").ToString() = "QW" Or
Session("rpt").ToString() = "MBM") Then
%>

<table border="9" align="center"
style="font-family: Arial; font-size: 8pt; border: medium none"
bordercolor="#000000">
<%
Else
%>

<tr>
<td><table border="9" align="center"
style="font-family: Arial; font-size: 9pt; border: medium none"
bordercolor="#000000">
<%
End IF
%>

<tr>
<%
'Put Headings On The Table of Field Names
'redim sData(rs.recordcount,175)
rownumber = 3
colnumber = 0
BeenThere = 0
lcnt = 0
numcols = 0
actualcols = 0
NrGroups = 0
For Each WhatCol In rstemp.Fields
If Len(WhatCol.Name) <> 1 Then
thisfield = WhatCol.Name
GroupField(lcnt) = 0
numcols = numcols + 1
%>

<td bgcolor="#FFFFFF" align="center"><p align="center"><font
color="#000000"><b><%= thisfield %></b></font></td>
<%
Else
'All 1 Character Field Names are Grouping Fields
'This sets up the grouping with hierachy determined from left to right in SQL
GroupField(lcnt) = 1
NrGroups = NrGroups + 1
End IF
actualcols = actualcols + 1
lcnt = lcnt + 1
Next
TBorder = "border:medium none "
'TBorder = "border-left: medium none; border-right: medium none;
border-top: medium double; border-bottom: medium none"
%>

</tr>
<%
'Now lets grab all the records
rownumber = 3
bgcolor = "white"
Do Until rstemp.EOF
%>

<tr>
<%
lcnt = 0
'Prepare Row for Printing
For Each WhatCol In rstemp.Fields
'Load data to array
sData(rownumber, lcnt) = WhatCol.Value
'If Data Type is currency, real or float
'response.write "QQ" & whatcol.type & "ZZ"
'response.write "name = " & whatcol.name
If WhatCol.Type = 6 Or WhatCol.Type = 5 Then
GrandTotal(lcnt + 1, 0) = GrandTotal(lcnt + 1, 0) +
WhatCol.Value
End IF
'Suppress Duplicates for Printing
'Set up the first row for Grouping
If rownumber = 3 Then
sData(rownumber - 1, lcnt) = WhatCol.Value
End IF
If (sData(rownumber, lcnt) = sData(rownumber - 1, lcnt)) AND
(WhatCol.Type <> 5 AND WhatCol.Type <> 6) Then
If rownumber = 3 Then
thisfield = WhatCol.Value
GroupField(lcnt) = GroupField(lcnt) + 1
Else
'Added the linecount < NrGroups times 2 which not
suppress duplicates on any field except Group Fields
'If you need to change it back insert (thisfield =
showblank) in place of If Statement.
If lcnt < (NrGroups * 2) + 1 Then
thisfield = showblank
GroupField(lcnt) = GroupField(lcnt) + 1
Else
thisfield = WhatCol.Value
End IF
End IF
Else
thisfield = sData(rownumber, lcnt)
GroupField(lcnt) = 0
End IF
'Total Rows Field Length is 1 Character
If Len(WhatCol.Name) <> 1 Then
If WhatCol.Type = 6 Or WhatCol.Type = 5 Then
thisfield = FormatNumber(CDbl(thisfield), 0)
End IF
%>

<td bgcolor="<%= bgcolor %>" valign="top" align="right"
style="border: medium none"><%= thisfield %>
<%
End IF
lcnt = lcnt + 1
Next
rstemp.MoveNext()
'set or reset data
ralign = "right"
'Change colors for every other line
If chgcolor = 0 Then
bgcolor = "#FFFFCC"
chgcolor = 1
Else
bgcolor = "White"
chgcolor = 0
End IF
'End Totals and Grouping
lcnt = 0
If Not rstemp.EOF Then
For Each WhatCol In rstemp.Fields
If Len(WhatCol.Name) = 1 Then
If WhatCol.Value.ToString() <> CStr(sData(rownumber,
lcnt)) Then
PrintTotal(lcnt) = lcnt
GroupField(lcnt) = 1
Else
'if rownumber<>3 then
rowCnt(lcnt) = rowCnt(lcnt) + 1
'end if
GroupField(lcnt) = 0
End IF
lcnt = lcnt + 1
End IF
Next
End IF
If rstemp.EOF Then
lcnt = 0
For Each WhatCol In rstemp.Fields
If Len(WhatCol.Name) = 1 Then
If sData(rownumber - 1, lcnt) = sData(rownumber, lcnt)
AND CStr(sData(rownumber, lcnt)) <> "" Then
PrintTotal(lcnt) = lcnt
GroupField(lcnt) = 1
'rowcnt(lcnt) = rowcnt(lcnt)+1
Else
PrintTotal(lcnt) = NrGroups + 1
'if rownumber<>3 then
rowCnt(lcnt) = 0
'end if
GroupField(lcnt) = 0
End IF
'lcnt = lcnt + 1
End IF
lcnt = lcnt + 1
Next
End IF
lcnt = 0
iGroup = 0
For tcnt = 0 To NrGroups
pcnt = NrGroups - tcnt
If CInt(PrintTotal(pcnt)) < NrGroups AND (CInt(GroupField(pcnt)) = 1 AND CInt(rowCnt(pcnt)) > 0) Then
GroupField(pcnt) = 0
'rowcnt(pcnt) = 0
If CInt(rowCnt(pcnt)) > 0 Then
Response.Write("</tr><tr>")
End IF
For Each WhatCol In rstemp.Fields
If Len(WhatCol.Name) <> 1 Then
If CInt(rowCnt(pcnt)) < 1 AND (WhatCol.Type = 5 AND WhatCol.Type = 6) Then
GrpTotal(lcnt, PrintTotal(pcnt)) = 0
End IF
If Len(WhatCol.Name) <> 1 AND (WhatCol.Type <> 5 AND WhatCol.Type <> 6) Then
If lcnt = CInt((NrGroups) + PrintTotal(pcnt))
Then
sTotals = CStr(sData(rownumber, lcnt))
'& "-" & rowcnt(pcnt) & WHATCOL.TYPE
Else
sTotals = showblank
End IF
If CInt(rowCnt(pcnt)) > 0 Then
Response.Write("<TD style=" & TBorder & "
ALIGN=" & ralign & " BGCOLOR=" & bgcolor & "><STRONG>" & sTotals &
"</FONT></STRONG></TD>")
End IF
End IF
If Len(WhatCol.Name) <> 1 AND (WhatCol.Type = 5 Or
WhatCol.Type = 6) Then
For colcount = 0 To rowCnt(pcnt)
atotals = sData(rownumber - colcount, lcnt) + atotals
Next
atotals = FormatNumber(CDbl(atotals), 0)
If CInt(rowCnt(pcnt)) > 0 Then
Response.Write("<TD style=" & TBorder & "
ALIGN=" & ralign & " BGCOLOR=" & bgcolor & "><STRONG>" & atotals &
"</FONT></STRONG></TD>")
End IF
GrpTotal(lcnt, PrintTotal(pcnt)) = 0
atotals = 0
End IF
End IF
lcnt = lcnt + 1
Next
If CInt(rowCnt(pcnt)) > 0 Then
Response.Write("</tr><tr>")
BeenThere = BeenThere + 1
End IF
rowCnt(pcnt) = 0
'Change colors for every other line
If chgcolor = 0 Then
bgcolor = "#FFFFCC"
chgcolor = 1
Else
bgcolor = "White"
chgcolor = 0
End IF
End IF
lcnt = 0
Next
rownumber = rownumber + 1
Loop
%>

</td>
</tr>
<tr>
<%
'Grand Total Routine
lcnt = 0
col1 = 0
If NrGroups > 0 Then
'If any 1 character fields where defined, Grand Totals will appear
For Each WhatCol In rstemp.Fields
If WhatCol.Type = 6 Or WhatCol.Type = 5 Then
sTotal = FormatNumber(CDbl(GrandTotal(lcnt + 1, 0)), 0)
%>

<td bgcolor="<%= bgcolor %>" valign="top" align="right"
style="border-left: medium none; border-right: medium none;
border-top: medium double; border-bottom: medium none"><strong><%= (sTotal) %></strong>
<%
sTotal = 0
Else
If Len(WhatCol.Name) <> 1 Then
If col1 = 0 Then
sTotal1 = "Grand Total"
col1 = 1
Else
sTotal1 = showblank
End IF
Else
sTotal1 = showblank
End IF
If Len(WhatCol.Name) <> 1 Then
%>
</td>
<td bgcolor="<%= bgcolor %>" valign="top" align="right"
style="border-left: medium none; border-right: medium none;
border-top: medium double; border-bottom: medium none"><strong><%= sTotal1
%></strong>
<%
End IF
End IF
lcnt = lcnt + 1
Next
%>
</td>
</tr>
<%
End IF
Session.Add("rptend", Timer())
Session.Add("rpttime", FormatNumber(CDbl(Session("rptend")) -
CDbl(Session("rptstart")), 1))
rstemp.Close()
rstemp = Nothing
conntemp.Close()
conntemp = Nothing
%>

</table>
<p><small><%
Response.Write("The report ran in " & Session("rpttime") & " second(s)") %>
</small></td>
</tr>
</table>
<!-------------------------------------------------------------------->

</body>
<script LANGUAGE="VBSCRIPT">
<!--
sub window_onload
updatestatus
end sub
Sub UpdateStatus
Status = "<%= mySQL %>"
end sub

-->
</script>

</html>

Nov 18 '05 #2
I tried this. Went in, found the dll & pdb file, and deleted them, then
opened Visual Studio 2003 and ran the application, hitting the same
breakpoint in the code. The breakpoint cursor would then skip about to the
same lines in the code (i.e. the 3rd statement inside an IF statement,
without ever hitting the if statement), until it appeared to be trying to
run beyond the end of the report.aspx file.

SC
"Manish" <jm*****@hotmail.com> wrote in message
news:uT**************@TK2MSFTNGP10.phx.gbl...
delete the dll & pdb file in bin folder and rebuild your solution.

--
------------------------------------
Make Unlimited phone calls from your PC to ANY phone in the World!
http://www.eboom.com/free/
<me@privacy.net> wrote in message
news:#b*************@TK2MSFTNGP11.phx.gbl...
I have a breakpoint in an aspx page that I'm using to try to trap some code
to see what's going on. I'm translating a page that is working in a
traditional ASP page, which takes several session variables, formats a
header, and assigns a sql stored procedure to be run and a report

generated
in a web browser.
The odd behavior occurs where I have my breakpoint, which is at the place where the variable "showblank" is set to = "&nbsp;". It'll hit the next
couple of lines, then skip down into the middle of the if rstemp.EOF

code -
like on the second response.write.

It then skips all over the place within the code, in the middle of if
statements, then on down thru the script at the bottom of the page. It
eventually gives me the error:

"Server Error in '/test' Application.


--------------------------------------------------------------------------
--
----
Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

[No relevant source lines]
Source File: c:\inetpub\wwwroot\test\sales\reportASP.aspx Line: 409

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an
object.]

ASP.reportasp_aspx.__Render__control1(HtmlTextWrit er __output, Control
parameterContainer) in c:\inetpub\wwwroot\test\sales\reportASP.aspx:409

System.Web.UI.Control.RenderChildren(HtmlTextWrite r
writer)System.Web.UI.Control.Render(HtmlTextWriter writer)

System.Web.UI.Control.RenderControl(HtmlTextWriter writer)

System.Web.UI.Page.ProcessRequestMain()


--------------------------------------------------------------------------
--
----

Version Information: Microsoft .NET Framework Version:1.1.4322.573;

ASP.NET
Version:1.1.4322.573 "

What appears to happen to generate the error is that it skips beyond the

end
of the .aspx page.

The parameter files are pieces that were originally Include files that

were
supposed to be called when it was run, but I pulled them into the
codebehind. They basically are if statements that set several session
variables that control what stored procedure is run and information we put on the header of the report page.

I'm lost as to why it skips around like it does. I have several asp pages in front of this one that have been converted, and they all seem to follow thru a logical step through, but not this one.

Any advice/help appreciated.

SC

The code follows:

<%@ Page language="vb" src="ReportASP.aspx.vb"
Inherits="reportASP.ReportASP_aspx_vb" Codebehind="reportasp.aspx.vb"
Debug="true" %>
<%@ Import Namespace = "nce.vbscript" %>
<!--#include file="reportheader.inc"-->
<% Exceptions() %>
<!-------------------------------------------------------------------->
<%

SetSaveAsName()

%>
<html>

<head>
<title>My Website Report</title>
</head>

<body link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF" topmargin="1">

<table border="0" width="100%">
<tr>
<td width="100%"><p align="center"><!--#include
file="remheader4d.inc"--> </td>
</tr>
<tr>
<%
FormatReportHeader()

%>

<%
If Ammospool = "" Then
If Session("rpt").ToString() = "QW" Then %>
<td width="100%"><p align="center"><font
color="#000000"><strong><small>Report:&nbsp; </small><%=
Session("RptJnumber") & " " & Session("rptYear") & " " & Session("Select") &
" " & AmmoSelect & " " & Session("ammo") & " " & Session("ranking")
%><small>
<%
Else %>
<td width="100%"><p align="center"><font
color="#000000"><strong><small>Report:&nbsp; </small><%=
Session("RptJnumber") & " " & Session("rptYear") & " Year " &
Session("Select") & " " & AmmoSelect & " " & Session("ammo") & " " &
Session("ranking") %><small>
<% End IF
Else %>
</small></strong></font></td>
<%
If Session("rpt").ToString() = "TAR" Or
Session("rpt").ToString() =
"MBM" Then
%>
<td width="100%"><p align="center"><font
color="#000000"><strong><small>Report:&nbsp; </small><%=
Session("RptJnumber") & " " & Session("rptYear") & " Year " &
Session("Select") & " " & " " & Session("ranking") %><small>
<% Else
If Session("select").ToString() = "J7QSUM" Or
Session("select").ToString() = "J7QDETAIL" Or
Session("select").ToString() =
"J7QSINGLE" Or Session("select").ToString() = "J7QSKU" Then
%>
<td width="100%"><p align="center"><font
color="#000000"><strong><small>Report:&nbsp; </small><%=
Session("RptJnumber") & " " & Session("rptYear") & " Year " &
Session("ranking") %><small>
<% Else %>
<td width="100%"><p align="center"><font
color="#000000"><strong><small>Report:&nbsp; </small><%=
Session("RptJnumber") & " " & Session("rptYear") & " Year " &
Session("Select") & " " & Ammospool & " " & Session("ranking") %><small>
<% End IF
End IF
End IF
%>
</small></strong></font></td>
</tr>
<tr>
<td width="100%"><p align="center"><font color="#000000"><small>Last
Updated: <%= __when %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Report Date:&nbsp;</small> <small><%= Today()
%></small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Report
Time:&nbsp;<%= TimeOfDay() %></small> <big><strong>&nbsp;</strong></big>
&nbsp;</font></td>
</tr>
<% SessionParameters() %>
<tr>
<td width="100%"><small><p align="center"><font color="#000000"><b>(
Selection: <%= Session("Selection") & " " & Session("POs")
%>)</b></font></small></td>
</tr>
</table>

<% J3Parameters() %>
<% J4Parameters() %>
<% J5Parameters() %>
<% J6Parameters() %>
<% J7Parameters() %>
<% J9Parameters() %>
<% I1Parameters() %>
<% rebateparameters() %>
<% springparameters() %>
<% qualificationparameters() %>
<% coopparameters() %>
<% specialreports() %>

<%

showblank = "&nbsp;"
shownull = "-null-"
conntemp = new ADODB.Connection()
conntemp.connectionstring = session("serverstring")
'conntemp.connectiontimeout = 900 ' (Add This line)
conntemp.CommandTimeout = 2000
Server.ScriptTimeout = 2000
Session.Add("rptstart", Timer())
conntemp.Open()
rstemp = conntemp.Execute(mySQL)
If rstemp.EOF Then
Response.Write("<b>No records matched<br>")
Response.Write(mySQL & "<br>So cannot make table...</b>")
conntemp.Close()
conntemp = Nothing
Response.End()
End IF
If Session("user").ToString() = "CHATHAMSC" Then
Response.Write(mySQL)
'for each strkey in session.contents
'response.write "(" & Session.contents.key(strkey) & ") " &
session.contents.item(strkey)& "<BR>"
'next
'' for each strkey in session.contents
'' if session.contents.item(strkey) <> "" then
'' response.write "(" & Session.contents.key(strkey) & ") "

& session.contents.item(strkey)& "<BR>"
'' end if
'' next
End IF
%>

<%
If (Session("Year").ToString() = "Sales" Or Session("Year").ToString() =
"Calendar") AND ((Session("Select").ToString() = "Material Number" AND
Session("matdesc").ToString() <> "") Or (Session("rpt").ToString() =
"J6" AND Session("select").ToString() = "Detail") Or (Session("rpt").ToString() =
"J5" AND Session("select").ToString() = "Detail")) Or
(Session("rpt").ToString() = "QD" Or Session("rpt").ToString() = "QW" Or
Session("rpt").ToString() = "MBM") Then
%>

<table border="9" align="center"
style="font-family: Arial; font-size: 8pt; border: medium none"
bordercolor="#000000">
<%
Else
%>

<tr>
<td><table border="9" align="center"
style="font-family: Arial; font-size: 9pt; border: medium none"
bordercolor="#000000">
<%
End IF
%>

<tr>
<%
'Put Headings On The Table of Field Names
'redim sData(rs.recordcount,175)
rownumber = 3
colnumber = 0
BeenThere = 0
lcnt = 0
numcols = 0
actualcols = 0
NrGroups = 0
For Each WhatCol In rstemp.Fields
If Len(WhatCol.Name) <> 1 Then
thisfield = WhatCol.Name
GroupField(lcnt) = 0
numcols = numcols + 1
%>

<td bgcolor="#FFFFFF" align="center"><p align="center"><font
color="#000000"><b><%= thisfield %></b></font></td>
<%
Else
'All 1 Character Field Names are Grouping Fields
'This sets up the grouping with hierachy determined from
left to
right in SQL
GroupField(lcnt) = 1
NrGroups = NrGroups + 1
End IF
actualcols = actualcols + 1
lcnt = lcnt + 1
Next
TBorder = "border:medium none "
'TBorder = "border-left: medium none; border-right: medium none;
border-top: medium double; border-bottom: medium none"
%>

</tr>
<%
'Now lets grab all the records
rownumber = 3
bgcolor = "white"
Do Until rstemp.EOF
%>

<tr>
<%
lcnt = 0
'Prepare Row for Printing
For Each WhatCol In rstemp.Fields
'Load data to array
sData(rownumber, lcnt) = WhatCol.Value
'If Data Type is currency, real or float
'response.write "QQ" & whatcol.type & "ZZ"
'response.write "name = " & whatcol.name
If WhatCol.Type = 6 Or WhatCol.Type = 5 Then
GrandTotal(lcnt + 1, 0) = GrandTotal(lcnt + 1, 0) +
WhatCol.Value
End IF
'Suppress Duplicates for Printing
'Set up the first row for Grouping
If rownumber = 3 Then
sData(rownumber - 1, lcnt) = WhatCol.Value
End IF
If (sData(rownumber, lcnt) = sData(rownumber - 1, lcnt)) AND
(WhatCol.Type <> 5 AND WhatCol.Type <> 6) Then
If rownumber = 3 Then
thisfield = WhatCol.Value
GroupField(lcnt) = GroupField(lcnt) + 1
Else
'Added the linecount < NrGroups times 2 which not
suppress duplicates on any field except Group Fields
'If you need to change it back insert (thisfield =
showblank) in place of If Statement.
If lcnt < (NrGroups * 2) + 1 Then
thisfield = showblank
GroupField(lcnt) = GroupField(lcnt) + 1
Else
thisfield = WhatCol.Value
End IF
End IF
Else
thisfield = sData(rownumber, lcnt)
GroupField(lcnt) = 0
End IF
'Total Rows Field Length is 1 Character
If Len(WhatCol.Name) <> 1 Then
If WhatCol.Type = 6 Or WhatCol.Type = 5 Then
thisfield = FormatNumber(CDbl(thisfield), 0)
End IF
%>

<td bgcolor="<%= bgcolor %>" valign="top" align="right"
style="border: medium none"><%= thisfield %>
<%
End IF
lcnt = lcnt + 1
Next
rstemp.MoveNext()
'set or reset data
ralign = "right"
'Change colors for every other line
If chgcolor = 0 Then
bgcolor = "#FFFFCC"
chgcolor = 1
Else
bgcolor = "White"
chgcolor = 0
End IF
'End Totals and Grouping
lcnt = 0
If Not rstemp.EOF Then
For Each WhatCol In rstemp.Fields
If Len(WhatCol.Name) = 1 Then
If WhatCol.Value.ToString() <> CStr(sData(rownumber,
lcnt)) Then
PrintTotal(lcnt) = lcnt
GroupField(lcnt) = 1
Else
'if rownumber<>3 then
rowCnt(lcnt) = rowCnt(lcnt) + 1
'end if
GroupField(lcnt) = 0
End IF
lcnt = lcnt + 1
End IF
Next
End IF
If rstemp.EOF Then
lcnt = 0
For Each WhatCol In rstemp.Fields
If Len(WhatCol.Name) = 1 Then
If sData(rownumber - 1, lcnt) = sData(rownumber,

lcnt) AND CStr(sData(rownumber, lcnt)) <> "" Then
PrintTotal(lcnt) = lcnt
GroupField(lcnt) = 1
'rowcnt(lcnt) = rowcnt(lcnt)+1
Else
PrintTotal(lcnt) = NrGroups + 1
'if rownumber<>3 then
rowCnt(lcnt) = 0
'end if
GroupField(lcnt) = 0
End IF
'lcnt = lcnt + 1
End IF
lcnt = lcnt + 1
Next
End IF
lcnt = 0
iGroup = 0
For tcnt = 0 To NrGroups
pcnt = NrGroups - tcnt
If CInt(PrintTotal(pcnt)) < NrGroups AND

(CInt(GroupField(pcnt))
= 1 AND CInt(rowCnt(pcnt)) > 0) Then
GroupField(pcnt) = 0
'rowcnt(pcnt) = 0
If CInt(rowCnt(pcnt)) > 0 Then
Response.Write("</tr><tr>")
End IF
For Each WhatCol In rstemp.Fields
If Len(WhatCol.Name) <> 1 Then
If CInt(rowCnt(pcnt)) < 1 AND (WhatCol.Type = 5

AND
WhatCol.Type = 6) Then
GrpTotal(lcnt, PrintTotal(pcnt)) = 0
End IF
If Len(WhatCol.Name) <> 1 AND (WhatCol.Type <> 5

AND
WhatCol.Type <> 6) Then
If lcnt = CInt((NrGroups) + PrintTotal(pcnt)) Then
sTotals = CStr(sData(rownumber, lcnt))
'& "-" & rowcnt(pcnt) & WHATCOL.TYPE
Else
sTotals = showblank
End IF
If CInt(rowCnt(pcnt)) > 0 Then
Response.Write("<TD style=" & TBorder & " ALIGN=" & ralign & " BGCOLOR=" & bgcolor & "><STRONG>" & sTotals &
"</FONT></STRONG></TD>")
End IF
End IF
If Len(WhatCol.Name) <> 1 AND (WhatCol.Type = 5 Or WhatCol.Type = 6) Then
For colcount = 0 To rowCnt(pcnt)
atotals = sData(rownumber - colcount,

lcnt)
+ atotals
Next
atotals = FormatNumber(CDbl(atotals), 0)
If CInt(rowCnt(pcnt)) > 0 Then
Response.Write("<TD style=" & TBorder & " ALIGN=" & ralign & " BGCOLOR=" & bgcolor & "><STRONG>" & atotals &
"</FONT></STRONG></TD>")
End IF
GrpTotal(lcnt, PrintTotal(pcnt)) = 0
atotals = 0
End IF
End IF
lcnt = lcnt + 1
Next
If CInt(rowCnt(pcnt)) > 0 Then
Response.Write("</tr><tr>")
BeenThere = BeenThere + 1
End IF
rowCnt(pcnt) = 0
'Change colors for every other line
If chgcolor = 0 Then
bgcolor = "#FFFFCC"
chgcolor = 1
Else
bgcolor = "White"
chgcolor = 0
End IF
End IF
lcnt = 0
Next
rownumber = rownumber + 1
Loop
%>

</td>
</tr>
<tr>
<%
'Grand Total Routine
lcnt = 0
col1 = 0
If NrGroups > 0 Then
'If any 1 character fields where defined, Grand Totals will appear For Each WhatCol In rstemp.Fields
If WhatCol.Type = 6 Or WhatCol.Type = 5 Then
sTotal = FormatNumber(CDbl(GrandTotal(lcnt + 1, 0)), 0)
%>

<td bgcolor="<%= bgcolor %>" valign="top" align="right"
style="border-left: medium none; border-right: medium none;
border-top: medium double; border-bottom: medium none"><strong><%=

(sTotal)
%></strong>
<%
sTotal = 0
Else
If Len(WhatCol.Name) <> 1 Then
If col1 = 0 Then
sTotal1 = "Grand Total"
col1 = 1
Else
sTotal1 = showblank
End IF
Else
sTotal1 = showblank
End IF
If Len(WhatCol.Name) <> 1 Then
%>
</td>
<td bgcolor="<%= bgcolor %>" valign="top" align="right"
style="border-left: medium none; border-right: medium none;
border-top: medium double; border-bottom: medium none"><strong><%= sTotal1 %></strong>
<%
End IF
End IF
lcnt = lcnt + 1
Next
%>
</td>
</tr>
<%
End IF
Session.Add("rptend", Timer())
Session.Add("rpttime", FormatNumber(CDbl(Session("rptend")) -
CDbl(Session("rptstart")), 1))
rstemp.Close()
rstemp = Nothing
conntemp.Close()
conntemp = Nothing
%>

</table>
<p><small><%
Response.Write("The report ran in " & Session("rpttime") & "

second(s)")
%>
</small></td>
</tr>
</table>
<!-------------------------------------------------------------------->

</body>
<script LANGUAGE="VBSCRIPT">
<!--
sub window_onload
updatestatus
end sub
Sub UpdateStatus
Status = "<%= mySQL %>"
end sub

-->
</script>

</html>


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8461
by: web developer | last post by:
hi i got a query that takes about 14 mins here it is select BDProduct.ProductCode,BDProduct.ProductName,SALTerritory.TerritoryID...
6
3761
by: Andrew V. Romero | last post by:
First off, I am mostly familier with PHP but am trying to make a multi-step javascript program. For an example, I would like to run different sections of the script depending on how many times the...
10
8097
by: tram | last post by:
How do we pass on the step1 output file to step2 of the same job? I would like to know the current job's output file programmetically, instead of hard coding it. Any idaes would be appreciated. ...
4
3350
by: Claudio Grondi | last post by:
I need to unpack on a Windows 2000 machine some Wikipedia media .tar archives which are compressed with TAR 1.14 (support for long file names and maybe some other features) . It seems, that...
0
288
by: Edi | last post by:
I want to debug my application and for that I use the step into debug command button. When I click on the step into command the next step ist executed. The executed step raises some events. Now I...
9
11844
by: ibm_97 | last post by:
Hi, Anyone can give me a link which shows how to setup DB2 (v8) replication step by step? Thanks. As a non-DB2 person, I find out IBM DB2 doc is not very helpful at all, espeically compare...
4
2642
by: light_wt | last post by:
Hi I am taking the 2555 class and a lot of the material is over my head. I don't like the MS's book because there is no step-by-step on interacting with the VS.NET Is there good free resource...
1
2666
by: Jim Hammond | last post by:
I can get data from a client-side assembly to the server in two manual steps, but I need to be able to do it in one step. Step 1: The user presses the manually coded "Step 1" button, which calls...
5
1748
by: ibiza | last post by:
Hi all, I'd need a function that would rounds values like : d = roundTo(64.2, 0.25) ' returns 64.25 d = roundTo(64.2, 10) ' returns 64 d = roundTo(64.2, 100) ' returns 100 well, that rounds...
1
1364
by: Andy B | last post by:
I have a wizard with multiple steps in it. On the first step, I have a gridView that shows the users current input for that particular step. The GridView is bound to an in memory object. When I...
0
7112
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6974
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7183
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6852
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5448
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4878
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4573
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
277
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.