473,800 Members | 2,893 Online
Bytes | Software Development & Data Engineering Community
+ 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.NullRefe renceException: Object reference not set
to an instance of an object.

Source Error:

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

Stack Trace:

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

ASP.reportasp_a spx.__Render__c ontrol1(HtmlTex tWriter __output, Control
parameterContai ner) in c:\inetpub\wwwr oot\test\sales\ reportASP.aspx: 409

System.Web.UI.C ontrol.RenderCh ildren(HtmlText Writer
writer)System.W eb.UI.Control.R ender(HtmlTextW riter writer)

System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer)

System.Web.UI.P age.ProcessRequ estMain()

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

Version Information: Microsoft .NET Framework Version:1.1.432 2.573; ASP.NET
Version:1.1.432 2.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="repor tASP.ReportASP_ aspx_vb" Codebehind="rep ortasp.aspx.vb"
Debug="true" %>
<%@ Import Namespace = "nce.vbscri pt" %>
<!--#include file="reporthea der.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="remheader 4d.inc"--> </td>
</tr>
<tr>
<%
FormatReportHea der()

%>

<%
If Ammospool = "" Then
If Session("rpt"). ToString() = "QW" Then %>
<td width="100%"><p align="center"> <font
color="#000000" ><strong><small >Report:&nbsp ; </small><%=
Session("RptJnu mber") & " " & Session("rptYea r") & " " & Session("Select ") &
" " & AmmoSelect & " " & Session("ammo") & " " & Session("rankin g")
%><small>
<%
Else %>
<td width="100%"><p align="center"> <font
color="#000000" ><strong><small >Report:&nbsp ; </small><%=
Session("RptJnu mber") & " " & Session("rptYea r") & " Year " &
Session("Select ") & " " & AmmoSelect & " " & Session("ammo") & " " &
Session("rankin g") %><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("RptJnu mber") & " " & Session("rptYea r") & " Year " &
Session("Select ") & " " & " " & Session("rankin g") %><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("RptJnu mber") & " " & Session("rptYea r") & " Year " &
Session("rankin g") %><small>
<% Else %>
<td width="100%"><p align="center"> <font
color="#000000" ><strong><small >Report:&nbsp ; </small><%=
Session("RptJnu mber") & " " & Session("rptYea r") & " Year " &
Session("Select ") & " " & Ammospool & " " & Session("rankin g") %><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;&nbs p;&nbsp;&nbsp;
Report Date:&nbsp;</small> <small><%= Today()
%></small>&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;&nb sp;
<small>&nbsp;&n bsp;&nbsp;&nbsp ;&nbsp;Report
Time:&nbsp;<%= TimeOfDay() %></small> <big><strong>&n bsp;</strong></big>
&nbsp;</font></td>
</tr>
<% SessionParamete rs() %>
<tr>
<td width="100%"><s mall><p align="center"> <font color="#000000" ><b>(
Selection: <%= Session("Select ion") & " " & Session("POs")
%>)</b></font></small></td>
</tr>
</table>

<% J3Parameters() %>
<% J4Parameters() %>
<% J5Parameters() %>
<% J6Parameters() %>
<% J7Parameters() %>
<% J9Parameters() %>
<% I1Parameters() %>
<% rebateparameter s() %>
<% springparameter s() %>
<% qualificationpa rameters() %>
<% coopparameters( ) %>
<% specialreports( ) %>

<%

showblank = "&nbsp;"
shownull = "-null-"
conntemp = new ADODB.Connectio n()
conntemp.connec tionstring = session("server string")
'conntemp.conne ctiontimeout = 900 ' (Add This line)
conntemp.Comman dTimeout = 2000
Server.ScriptTi meout = 2000
Session.Add("rp tstart", Timer())
conntemp.Open()
rstemp = conntemp.Execut e(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.content s
'response.write "(" & Session.content s.key(strkey) & ") " &
session.content s.item(strkey)& "<BR>"
'next
'' for each strkey in session.content s
'' if session.content s.item(strkey) <> "" then
'' response.write "(" & Session.content s.key(strkey) & ") " &
session.content s.item(strkey)& "<BR>"
'' end if
'' next
End IF
%>

<%
If (Session("Year" ).ToString() = "Sales" Or Session("Year") .ToString() =
"Calendar") AND ((Session("Sele ct").ToString () = "Material Number" AND
Session("matdes c").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="#0 00000">
<%
Else
%>

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

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

<td bgcolor="#FFFFF F" 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:med ium 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(rownumbe r, 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.Nam e) <> 1 Then
If WhatCol.Type = 6 Or WhatCol.Type = 5 Then
thisfield = FormatNumber(CD bl(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.Nam e) = 1 Then
If WhatCol.Value.T oString() <> CStr(sData(rown umber,
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.Nam e) = 1 Then
If sData(rownumber - 1, lcnt) = sData(rownumber , lcnt)
AND CStr(sData(rown umber, 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(GroupFiel d(pcnt))
= 1 AND CInt(rowCnt(pcn t)) > 0) Then
GroupField(pcnt ) = 0
'rowcnt(pcnt) = 0
If CInt(rowCnt(pcn t)) > 0 Then
Response.Write( "</tr><tr>")
End IF
For Each WhatCol In rstemp.Fields
If Len(WhatCol.Nam e) <> 1 Then
If CInt(rowCnt(pcn t)) < 1 AND (WhatCol.Type = 5 AND
WhatCol.Type = 6) Then
GrpTotal(lcnt, PrintTotal(pcnt )) = 0
End IF
If Len(WhatCol.Nam e) <> 1 AND (WhatCol.Type <> 5 AND
WhatCol.Type <> 6) Then
If lcnt = CInt((NrGroups) + PrintTotal(pcnt ))
Then
sTotals = CStr(sData(rown umber, lcnt))
'& "-" & rowcnt(pcnt) & WHATCOL.TYPE
Else
sTotals = showblank
End IF
If CInt(rowCnt(pcn t)) > 0 Then
Response.Write( "<TD style=" & TBorder & "
ALIGN=" & ralign & " BGCOLOR=" & bgcolor & "><STRONG>" & sTotals &
"</FONT></STRONG></TD>")
End IF
End IF
If Len(WhatCol.Nam e) <> 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(CD bl(atotals), 0)
If CInt(rowCnt(pcn t)) > 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(pcn t)) > 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(CD bl(GrandTotal(l cnt + 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.Nam e) <> 1 Then
If col1 = 0 Then
sTotal1 = "Grand Total"
col1 = 1
Else
sTotal1 = showblank
End IF
Else
sTotal1 = showblank
End IF
If Len(WhatCol.Nam e) <> 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("rp tend", Timer())
Session.Add("rp ttime", FormatNumber(CD bl(Session("rpt end")) -
CDbl(Session("r ptstart")), 1))
rstemp.Close()
rstemp = Nothing
conntemp.Close( )
conntemp = Nothing
%>

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

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

-->
</script>

</html>
Nov 18 '05 #1
2 1736
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******** *****@TK2MSFTNG P11.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.NullRefe renceException: Object reference not set
to an instance of an object.

Source Error:

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

Stack Trace:

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

ASP.reportasp_a spx.__Render__c ontrol1(HtmlTex tWriter __output, Control
parameterContai ner) in c:\inetpub\wwwr oot\test\sales\ reportASP.aspx: 409

System.Web.UI.C ontrol.RenderCh ildren(HtmlText Writer
writer)System.W eb.UI.Control.R ender(HtmlTextW riter writer)

System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer)

System.Web.UI.P age.ProcessRequ estMain()

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

Version Information: Microsoft .NET Framework Version:1.1.432 2.573; ASP.NET Version:1.1.432 2.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="repor tASP.ReportASP_ aspx_vb" Codebehind="rep ortasp.aspx.vb"
Debug="true" %>
<%@ Import Namespace = "nce.vbscri pt" %>
<!--#include file="reporthea der.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="remheader 4d.inc"--> </td>
</tr>
<tr>
<%
FormatReportHea der()

%>

<%
If Ammospool = "" Then
If Session("rpt"). ToString() = "QW" Then %>
<td width="100%"><p align="center"> <font
color="#000000" ><strong><small >Report:&nbsp ; </small><%=
Session("RptJnu mber") & " " & Session("rptYea r") & " " & Session("Select ") & " " & AmmoSelect & " " & Session("ammo") & " " & Session("rankin g")
%><small>
<%
Else %>
<td width="100%"><p align="center"> <font
color="#000000" ><strong><small >Report:&nbsp ; </small><%=
Session("RptJnu mber") & " " & Session("rptYea r") & " Year " &
Session("Select ") & " " & AmmoSelect & " " & Session("ammo") & " " &
Session("rankin g") %><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("RptJnu mber") & " " & Session("rptYea r") & " Year " &
Session("Select ") & " " & " " & Session("rankin g") %><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("RptJnu mber") & " " & Session("rptYea r") & " Year " &
Session("rankin g") %><small>
<% Else %>
<td width="100%"><p align="center"> <font
color="#000000" ><strong><small >Report:&nbsp ; </small><%=
Session("RptJnu mber") & " " & Session("rptYea r") & " Year " &
Session("Select ") & " " & Ammospool & " " & Session("rankin g") %><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;&nbs p;&nbsp;&nbsp;
Report Date:&nbsp;</small> <small><%= Today()
%></small>&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;&nb sp;
<small>&nbsp;&n bsp;&nbsp;&nbsp ;&nbsp;Report
Time:&nbsp;<%= TimeOfDay() %></small> <big><strong>&n bsp;</strong></big> &nbsp;</font></td>
</tr>
<% SessionParamete rs() %>
<tr>
<td width="100%"><s mall><p align="center"> <font color="#000000" ><b>(
Selection: <%= Session("Select ion") & " " & Session("POs")
%>)</b></font></small></td>
</tr>
</table>

<% J3Parameters() %>
<% J4Parameters() %>
<% J5Parameters() %>
<% J6Parameters() %>
<% J7Parameters() %>
<% J9Parameters() %>
<% I1Parameters() %>
<% rebateparameter s() %>
<% springparameter s() %>
<% qualificationpa rameters() %>
<% coopparameters( ) %>
<% specialreports( ) %>

<%

showblank = "&nbsp;"
shownull = "-null-"
conntemp = new ADODB.Connectio n()
conntemp.connec tionstring = session("server string")
'conntemp.conne ctiontimeout = 900 ' (Add This line)
conntemp.Comman dTimeout = 2000
Server.ScriptTi meout = 2000
Session.Add("rp tstart", Timer())
conntemp.Open()
rstemp = conntemp.Execut e(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.content s
'response.write "(" & Session.content s.key(strkey) & ") " &
session.content s.item(strkey)& "<BR>"
'next
'' for each strkey in session.content s
'' if session.content s.item(strkey) <> "" then
'' response.write "(" & Session.content s.key(strkey) & ") " &
session.content s.item(strkey)& "<BR>"
'' end if
'' next
End IF
%>

<%
If (Session("Year" ).ToString() = "Sales" Or Session("Year") .ToString() = "Calendar") AND ((Session("Sele ct").ToString () = "Material Number" AND
Session("matdes c").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="#0 00000">
<%
Else
%>

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

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

<td bgcolor="#FFFFF F" 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:med ium 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(rownumbe r, 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.Nam e) <> 1 Then
If WhatCol.Type = 6 Or WhatCol.Type = 5 Then
thisfield = FormatNumber(CD bl(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.Nam e) = 1 Then
If WhatCol.Value.T oString() <> CStr(sData(rown umber,
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.Nam e) = 1 Then
If sData(rownumber - 1, lcnt) = sData(rownumber , lcnt)
AND CStr(sData(rown umber, 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(GroupFiel d(pcnt)) = 1 AND CInt(rowCnt(pcn t)) > 0) Then
GroupField(pcnt ) = 0
'rowcnt(pcnt) = 0
If CInt(rowCnt(pcn t)) > 0 Then
Response.Write( "</tr><tr>")
End IF
For Each WhatCol In rstemp.Fields
If Len(WhatCol.Nam e) <> 1 Then
If CInt(rowCnt(pcn t)) < 1 AND (WhatCol.Type = 5 AND WhatCol.Type = 6) Then
GrpTotal(lcnt, PrintTotal(pcnt )) = 0
End IF
If Len(WhatCol.Nam e) <> 1 AND (WhatCol.Type <> 5 AND WhatCol.Type <> 6) Then
If lcnt = CInt((NrGroups) + PrintTotal(pcnt ))
Then
sTotals = CStr(sData(rown umber, lcnt))
'& "-" & rowcnt(pcnt) & WHATCOL.TYPE
Else
sTotals = showblank
End IF
If CInt(rowCnt(pcn t)) > 0 Then
Response.Write( "<TD style=" & TBorder & "
ALIGN=" & ralign & " BGCOLOR=" & bgcolor & "><STRONG>" & sTotals &
"</FONT></STRONG></TD>")
End IF
End IF
If Len(WhatCol.Nam e) <> 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(CD bl(atotals), 0)
If CInt(rowCnt(pcn t)) > 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(pcn t)) > 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(CD bl(GrandTotal(l cnt + 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.Nam e) <> 1 Then
If col1 = 0 Then
sTotal1 = "Grand Total"
col1 = 1
Else
sTotal1 = showblank
End IF
Else
sTotal1 = showblank
End IF
If Len(WhatCol.Nam e) <> 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("rp tend", Timer())
Session.Add("rp ttime", FormatNumber(CD bl(Session("rpt end")) -
CDbl(Session("r ptstart")), 1))
rstemp.Close()
rstemp = Nothing
conntemp.Close( )
conntemp = Nothing
%>

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

</body>
<script LANGUAGE="VBSCR IPT">
<!--
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*****@hotmai l.com> wrote in message
news:uT******** ******@TK2MSFTN GP10.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******** *****@TK2MSFTNG P11.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.NullRefe renceException: Object reference not set to an instance of an object.

Source Error:

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

Stack Trace:

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

ASP.reportasp_a spx.__Render__c ontrol1(HtmlTex tWriter __output, Control
parameterContai ner) in c:\inetpub\wwwr oot\test\sales\ reportASP.aspx: 409

System.Web.UI.C ontrol.RenderCh ildren(HtmlText Writer
writer)System.W eb.UI.Control.R ender(HtmlTextW riter writer)

System.Web.UI.C ontrol.RenderCo ntrol(HtmlTextW riter writer)

System.Web.UI.P age.ProcessRequ estMain()


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

Version Information: Microsoft .NET Framework Version:1.1.432 2.573;

ASP.NET
Version:1.1.432 2.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="repor tASP.ReportASP_ aspx_vb" Codebehind="rep ortasp.aspx.vb"
Debug="true" %>
<%@ Import Namespace = "nce.vbscri pt" %>
<!--#include file="reporthea der.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="remheader 4d.inc"--> </td>
</tr>
<tr>
<%
FormatReportHea der()

%>

<%
If Ammospool = "" Then
If Session("rpt"). ToString() = "QW" Then %>
<td width="100%"><p align="center"> <font
color="#000000" ><strong><small >Report:&nbsp ; </small><%=
Session("RptJnu mber") & " " & Session("rptYea r") & " " & Session("Select ") &
" " & AmmoSelect & " " & Session("ammo") & " " & Session("rankin g")
%><small>
<%
Else %>
<td width="100%"><p align="center"> <font
color="#000000" ><strong><small >Report:&nbsp ; </small><%=
Session("RptJnu mber") & " " & Session("rptYea r") & " Year " &
Session("Select ") & " " & AmmoSelect & " " & Session("ammo") & " " &
Session("rankin g") %><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("RptJnu mber") & " " & Session("rptYea r") & " Year " &
Session("Select ") & " " & " " & Session("rankin g") %><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("RptJnu mber") & " " & Session("rptYea r") & " Year " &
Session("rankin g") %><small>
<% Else %>
<td width="100%"><p align="center"> <font
color="#000000" ><strong><small >Report:&nbsp ; </small><%=
Session("RptJnu mber") & " " & Session("rptYea r") & " Year " &
Session("Select ") & " " & Ammospool & " " & Session("rankin g") %><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;&nbs p;&nbsp;&nbsp;
Report Date:&nbsp;</small> <small><%= Today()
%></small>&nbsp;&nb sp;&nbsp;&nbsp; &nbsp;&nbsp;&nb sp;
<small>&nbsp;&n bsp;&nbsp;&nbsp ;&nbsp;Report
Time:&nbsp;<%= TimeOfDay() %></small> <big><strong>&n bsp;</strong></big>
&nbsp;</font></td>
</tr>
<% SessionParamete rs() %>
<tr>
<td width="100%"><s mall><p align="center"> <font color="#000000" ><b>(
Selection: <%= Session("Select ion") & " " & Session("POs")
%>)</b></font></small></td>
</tr>
</table>

<% J3Parameters() %>
<% J4Parameters() %>
<% J5Parameters() %>
<% J6Parameters() %>
<% J7Parameters() %>
<% J9Parameters() %>
<% I1Parameters() %>
<% rebateparameter s() %>
<% springparameter s() %>
<% qualificationpa rameters() %>
<% coopparameters( ) %>
<% specialreports( ) %>

<%

showblank = "&nbsp;"
shownull = "-null-"
conntemp = new ADODB.Connectio n()
conntemp.connec tionstring = session("server string")
'conntemp.conne ctiontimeout = 900 ' (Add This line)
conntemp.Comman dTimeout = 2000
Server.ScriptTi meout = 2000
Session.Add("rp tstart", Timer())
conntemp.Open()
rstemp = conntemp.Execut e(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.content s
'response.write "(" & Session.content s.key(strkey) & ") " &
session.content s.item(strkey)& "<BR>"
'next
'' for each strkey in session.content s
'' if session.content s.item(strkey) <> "" then
'' response.write "(" & Session.content s.key(strkey) & ") "

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

<%
If (Session("Year" ).ToString() = "Sales" Or Session("Year") .ToString() =
"Calendar") AND ((Session("Sele ct").ToString () = "Material Number" AND
Session("matdes c").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="#0 00000">
<%
Else
%>

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

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

<td bgcolor="#FFFFF F" 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:med ium 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(rownumbe r, 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.Nam e) <> 1 Then
If WhatCol.Type = 6 Or WhatCol.Type = 5 Then
thisfield = FormatNumber(CD bl(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.Nam e) = 1 Then
If WhatCol.Value.T oString() <> CStr(sData(rown umber,
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.Nam e) = 1 Then
If sData(rownumber - 1, lcnt) = sData(rownumber ,

lcnt) AND CStr(sData(rown umber, 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(GroupFiel d(pcnt))
= 1 AND CInt(rowCnt(pcn t)) > 0) Then
GroupField(pcnt ) = 0
'rowcnt(pcnt) = 0
If CInt(rowCnt(pcn t)) > 0 Then
Response.Write( "</tr><tr>")
End IF
For Each WhatCol In rstemp.Fields
If Len(WhatCol.Nam e) <> 1 Then
If CInt(rowCnt(pcn t)) < 1 AND (WhatCol.Type = 5

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

AND
WhatCol.Type <> 6) Then
If lcnt = CInt((NrGroups) + PrintTotal(pcnt )) Then
sTotals = CStr(sData(rown umber, lcnt))
'& "-" & rowcnt(pcnt) & WHATCOL.TYPE
Else
sTotals = showblank
End IF
If CInt(rowCnt(pcn t)) > 0 Then
Response.Write( "<TD style=" & TBorder & " ALIGN=" & ralign & " BGCOLOR=" & bgcolor & "><STRONG>" & sTotals &
"</FONT></STRONG></TD>")
End IF
End IF
If Len(WhatCol.Nam e) <> 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(CD bl(atotals), 0)
If CInt(rowCnt(pcn t)) > 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(pcn t)) > 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(CD bl(GrandTotal(l cnt + 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.Nam e) <> 1 Then
If col1 = 0 Then
sTotal1 = "Grand Total"
col1 = 1
Else
sTotal1 = showblank
End IF
Else
sTotal1 = showblank
End IF
If Len(WhatCol.Nam e) <> 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("rp tend", Timer())
Session.Add("rp ttime", FormatNumber(CD bl(Session("rpt end")) -
CDbl(Session("r ptstart")), 1))
rstemp.Close()
rstemp = Nothing
conntemp.Close( )
conntemp = Nothing
%>

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

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

</body>
<script LANGUAGE="VBSCR IPT">
<!--
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
8471
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 ,SALTerritory.TerritoryName,SALAccount.AccountID,SALAccount.AccountName ,sum(SalesNetFact.Qty2) as Quantity ,sum(SalesNetFact.bonus) as Bonus from SalesNetFact inner join BDProduct on BDProduct.ProductID=SalesNetFact.ProductID
6
3781
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 user presses the submit button: <form method="post" name="step1" action="test.html"> <script language="JavaScript"> var position
10
8177
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. Thanks
4
3371
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 Pythons tarfile module is able to list far more files inside the archives than WinRAR or 7zip or TotalCommander, but will it unpack all available files (largest archive size 17 GByte)? If tarfile is build on TAR 1.14 or TAR 1.15 it will be
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 want to step into the EventHandlers of the raised events without setting a breakpoint. How can this be done?
9
11879
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 with Oracle docs. Regards,
4
2659
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 in the web? If not, I have pulled a few books in the following. I am wondering which book has the concise step-by-step with lots of pictures helping to navigate on how to do something simple, i.e. concept of tabbed dialog box, web form, asp.net,...
1
2683
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 the JavaScript function. The function copies the data into a server textbox control. Step 2: The user presses the VS generated "Step 2" button, which calls the
5
1764
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 a value to the given step...with rounding up if it is it is right in the middle (e.g. 1.25 to 1.5 with a step of 0.25)
1
1382
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 press the next button to go to the next step, and then click the link in the navbar to get back to the first step, all of the data in the gridView is gone. How do you rebind the gridview when doing stuff like that? And for that matter, How do I tell...
0
10501
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10273
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10250
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9085
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7574
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.