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

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

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

Data present in source code but not visible on the page.

Status
Not open for further replies.

ChaseMIS

MIS
Jul 31, 2001
23
US
Hello everyone,

This is a very, very strange problem that I have never encountered before. I have an ASP page that is making a standard table from a SQL statement that queries our database. There are also a couple of javascripts that scale one table to another and keep the header table at the top of the page all the time. Often, when the button is clicked to produce the page, the header table is pulled up and scaled properly, but the data table is not visible. When I look at the source code, however, the data is definitely there on the page. For some reason, I just can't see it. If I refresh the page 2 or 3 times, the data eventually does become visible even though I have changed nothing. For some reason this is unacceptable to the AVP in charge of the project, ha, ha, ha. If any of you have seen something like this I would appreciate the help. I don't even know where to look for a solution.

Thanks,
Derek
 
can I have some code to gaze at. If I had to guess there is a conflict going on between the jscript and the asp somehow. [bomb]
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
 
onpnt,

Thanks for responding. Here is a copy of the code. I'm sorry it is so long. If you can find a conflict that would be great because I really don't know what else to do. I am fairly new to ASP and really new to javascript. I did have to take a couple of i's with brackets out of the javascript portion and replace the brackets with parentheses so that tek-tips didn't interpret it as an italics indicator.

Thanks again,
Derek

Code:
<%@ Language=VBScript %>
<%  Option Explicit %>
<!-- #include file=&quot;Utility_ConnectionString.asp&quot; -->
<% Response.Expires = 0 %>
<link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;IP_Utility_StyleSheet.css&quot;> 
<meta>
<html>
<head>

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
<!--

var ColumnHeaders = new Array('Site','Bucket','Supervisor','Collector','Total','One','Two','Three','Four','Five','Six','Seven','Eight','Nine','Ten','Eleven','Twelve','Thirteen','Fourteen','Fifteen','Sixteen','Seventeen','Eighteen','Nineteen','Twenty');
var old,theTop,menu,temp;
var menu,scrollIt;
var theTop = 30
var old = theTop;

function scale()
{
	if (temp) clearTimeout(temp);
		extra = 1;
	var a = new getObj('fixedtable1');
	var b = new getObj('normaltable');
	for (i=0;i<ColumnHeaders.length;i++)
	{
		y = new getObj(ColumnHeaders(i)+'Body');
		z = new getObj(ColumnHeaders(i)+'Head');
		x = y.obj.offsetWidth - extra;
		z.style.width = x;
	}
	theTop = b.obj.offsetTop - a.obj.offsetHeight;
	a.style.left = b.obj.offsetLeft;
	old=theTop;
	menu = new getObj('fixedtable1');
	movemenu();
}

function getObj(ObjectName)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(ObjectName);
	this.style = document.getElementById(ObjectName).style;
  }
  else if (document.all)
  {
	this.obj = document.all[ObjectName];
	this.style = document.all[ObjectName].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[ObjectName];
   	this.style = document.layers[ObjectName];
  }
}

function movemenu()
{
	if (window.innerHeight)
	{
		  pos = window.pageYOffset
	}
	else if (document.documentElement && document.documentElement.scrollTop)
	{
		pos = document.documentElement.scrollTop
	}
	else if (document.body)
	{
		  pos = document.body.scrollTop
	}
	if (pos < theTop) pos = theTop;
	if (pos == old)
	{
		menu.style.top = pos;
	}
	old = pos;
	temp = setTimeout('movemenu()',250);
}

window.onresize = scale;

// -->

</SCRIPT>

<title>Immediate Pay - Collector Totals</title>
</HEAD>

<BODY bgcolor=#eaeafd onload=&quot;Javascript: scale();parent.FrameNavigation.document.location.reload();&quot;>
<%
ON error resume next

Dim strConnectDMBACK, objDB, rstCollectorTotals, rstCollectorTotalsSum, rstSupervisors, strCollectorTotalsTable, strTemp, strOutput, intCount, strMonth, strRegion, strBucket, strSupervisor

strMonth = Session.Contents(&quot;Month&quot;)
strRegion = Session.Contents(&quot;Region&quot;)
strBucket = Session.Contents(&quot;Bucket&quot;)
strSupervisor = Session.Contents(&quot;Supervisor&quot;)

set objDB = server.CreateObject (&quot;ADODB.Connection&quot;) 
set rstCollectorTotals = server.CreateObject (&quot;ADODB.Recordset&quot;)
set rstCollectorTotalsSum = server.CreateObject (&quot;ADODB.Recordset&quot;)

objDB.Open strConnectDMBACK

	rstCollectorTotals.Open &quot;SELECT tbl_IP_CollectorTotals.Supervisor, &quot; & _
						&quot;tbl_IP_CollectorTotals.CollectorSite, &quot; & _
						&quot;tbl_IP_CollectorTotals.Bucket, &quot; & _
						&quot;tbl_IP_CollectorTotals.Collector, &quot; & _
						&quot;tbl_IP_CollectorTotals.Total, &quot; & _
						&quot;tbl_IP_CollectorTotals.[01] as [1],&quot; & _
						&quot;tbl_IP_CollectorTotals.[02] as [2],&quot; & _
						&quot;tbl_IP_CollectorTotals.[03] as [3],&quot; & _
						&quot;tbl_IP_CollectorTotals.[04] as [4],&quot; & _
						&quot;tbl_IP_CollectorTotals.[05] as [5],&quot; & _
						&quot;tbl_IP_CollectorTotals.[06] as [6],&quot; & _
						&quot;tbl_IP_CollectorTotals.[07] as [7],&quot; & _
						&quot;tbl_IP_CollectorTotals.[08] as [8],&quot; & _
						&quot;tbl_IP_CollectorTotals.[09] as [9],&quot; & _
						&quot;tbl_IP_CollectorTotals.[10],&quot; & _
						&quot;tbl_IP_CollectorTotals.[11],&quot; & _
						&quot;tbl_IP_CollectorTotals.[12],&quot; & _
						&quot;tbl_IP_CollectorTotals.[13],&quot; & _
						&quot;tbl_IP_CollectorTotals.[14],&quot; & _
						&quot;tbl_IP_CollectorTotals.[15],&quot; & _
						&quot;tbl_IP_CollectorTotals.[16],&quot; & _
						&quot;tbl_IP_CollectorTotals.[17],&quot; & _
						&quot;tbl_IP_CollectorTotals.[18],&quot; & _
						&quot;tbl_IP_CollectorTotals.[19],&quot; & _
						&quot;tbl_IP_CollectorTotals.[20] &quot; & _
						&quot;FROM tbl_IP_CollectorTotals &quot; & _
						&quot;WHERE (CollectorSite = '&quot; & strRegion & &quot;') &quot; & _
						&quot;AND (Bucket = '&quot; & strBucket & &quot;') &quot; & _
						&quot;AND (Month = '&quot; & strMonth & &quot;') &quot; & _
						&quot;ORDER BY CollectorSite, Bucket, Supervisor, Collector&quot;, strConnectDMBACK
	rstCollectorTotalsSum.Open &quot;SELECT Sum(tbl_IP_CollectorTotals.Total) as Total, &quot; & _
						&quot;Sum(tbl_IP_CollectorTotals.[01]) as [1],&quot; & _
						&quot;Sum(tbl_IP_CollectorTotals.[02]) as [2],&quot; & _
						&quot;Sum(tbl_IP_CollectorTotals.[03]) as [3],&quot; & _
						&quot;Sum(tbl_IP_CollectorTotals.[04]) as [4],&quot; & _
						&quot;Sum(tbl_IP_CollectorTotals.[05]) as [5],&quot; & _
						&quot;Sum(tbl_IP_CollectorTotals.[06]) as [6],&quot; & _
						&quot;Sum(tbl_IP_CollectorTotals.[07]) as [7],&quot; & _
						&quot;Sum(tbl_IP_CollectorTotals.[08]) as [8],&quot; & _
						&quot;Sum(tbl_IP_CollectorTotals.[09]) as [9],&quot; & _
						&quot;Sum(tbl_IP_CollectorTotals.[10]) as [10],&quot; & _
						&quot;Sum(tbl_IP_CollectorTotals.[11]) as [11],&quot; & _
						&quot;Sum(tbl_IP_CollectorTotals.[12]) as [12],&quot; & _
						&quot;Sum(tbl_IP_CollectorTotals.[13]) as [13],&quot; & _
						&quot;Sum(tbl_IP_CollectorTotals.[14]) as [14],&quot; & _
						&quot;Sum(tbl_IP_CollectorTotals.[15]) as [15],&quot; & _
						&quot;Sum(tbl_IP_CollectorTotals.[16]) as [16],&quot; & _
						&quot;Sum(tbl_IP_CollectorTotals.[17]) as [17],&quot; & _
						&quot;Sum(tbl_IP_CollectorTotals.[18]) as [18],&quot; & _
						&quot;Sum(tbl_IP_CollectorTotals.[19]) as [19],&quot; & _
						&quot;Sum(tbl_IP_CollectorTotals.[20]) as [20] &quot; & _
						&quot;FROM tbl_IP_CollectorTotals &quot; & _
						&quot;WHERE (CollectorSite = '&quot; & strRegion & &quot;') &quot; & _
						&quot;AND (Bucket = '&quot; & strBucket & &quot;') &quot; & _
						&quot;AND (Month = '&quot; & strMonth & &quot;')&quot;, strConnectDMBACK
%>
<br>
<DIV ID=&quot;fixedtable1&quot;>
<TABLE cellspacing=0 Cellpadding=0>
	<tr bgcolor=#000080><Font Color=White>
		<td id=&quot;SiteHead&quot;><Font Color=White>Site</font></td>
		<td id=&quot;BucketHead&quot;><Font Color=White>Bucket</font></td>
		<td id=&quot;SupervisorHead&quot;><Font Color=White>Supervisor</font></td>
		<td id=&quot;CollectorHead&quot;><Font Color=White>Collector</font></td>
		<td id=&quot;TotalHead&quot;><Font Color=White>Total</font></td>
		<td id=&quot;OneHead&quot;><Font Color=White>1</font></td>
		<td id=&quot;TwoHead&quot;><Font Color=White>2</font></td>
		<td id=&quot;ThreeHead&quot;><Font Color=White>3</font></td>
		<td id=&quot;FourHead&quot;><Font Color=White>4</font></td>
		<td id=&quot;FiveHead&quot;><Font Color=White>5</font></td>
		<td id=&quot;SixHead&quot;><Font Color=White>6</font></td>
		<td id=&quot;SevenHead&quot;><Font Color=White>7</font></td>
		<td id=&quot;EightHead&quot;><Font Color=White>8</font></td>
		<td id=&quot;NineHead&quot;><Font Color=White>9</font></td>
		<td id=&quot;TenHead&quot;><Font Color=White>10</font></td>
		<td id=&quot;ElevenHead&quot;><Font Color=White>11</font></td>
		<td id=&quot;TwelveHead&quot;><Font Color=White>12</font></td>
		<td id=&quot;ThirteenHead&quot;><Font Color=White>13</font></td>
		<td id=&quot;FourteenHead&quot;><Font Color=White>14</font></td>
		<td id=&quot;FifteenHead&quot;><Font Color=White>15</font></td>
		<td id=&quot;SixteenHead&quot;><Font Color=White>16</font></td>
		<td id=&quot;SeventeenHead&quot;><Font Color=White>17</font></td>
		<td id=&quot;EighteenHead&quot;><Font Color=White>18</font></td>
		<td id=&quot;NineteenHead&quot;><Font Color=White>19</font></td>
		<td id=&quot;TwentyHead&quot;><Font Color=White>20</font></td>
	</tr>
</Table>
</Div>

<DIV ID=&quot;normaltable&quot;>
<TABLE cellspacing=0 Cellpadding=0>
<% 
intCount = 1
Do while not rstCollectorTotals.EOF 
	Response.Write (&quot;<tr&quot;)
		If Eval(intCount\2 = intCount/2) Then 'determine if the number is odd or even
			Response.Write &quot; bgcolor=Gainsboro>&quot;
		Else
			Response.Write &quot; bgcolor=White>&quot;
		End If
	intCount = intCount + 1  'increment the counter
	%>
		<td>   <% = rstCollectorTotals.Fields(&quot;CollectorSite&quot;) %>   </td>
		<td nowrap>  <% if rstCollectorTotals.Fields(&quot;Bucket&quot;) = &quot;ACD&quot; or rstCollectorTotals.Fields(&quot;Bucket&quot;) = &quot;CRG&quot; then 
						Response.Write (&quot; &quot; & rstCollectorTotals.Fields(&quot;Bucket&quot;) & &quot; &quot;)
					else
						Response.Write (PCase(rstCollectorTotals.Fields(&quot;Bucket&quot;)))
					end if %>  </td>
		<td nowrap> <% = (PCase(rstCollectorTotals.Fields(&quot;Supervisor&quot;))) %> </td>
		<td nowrap> <% = (PCase(rstCollectorTotals.Fields(&quot;Collector&quot;))) %> </td>
		<td><% = FormatNumber(rstCollectorTotals.Fields(&quot;Total&quot;),0) %></td>
		<td><% = FormatNumber(rstCollectorTotals.Fields(&quot;1&quot;),0) %></td>
		<td><% = FormatNumber(rstCollectorTotals.Fields(&quot;2&quot;),0) %></td>
		<td><% = FormatNumber(rstCollectorTotals.Fields(&quot;3&quot;),0) %></td>
		<td><% = FormatNumber(rstCollectorTotals.Fields(&quot;4&quot;),0) %></td>
		<td><% = FormatNumber(rstCollectorTotals.Fields(&quot;5&quot;),0) %></td>
		<td><% = FormatNumber(rstCollectorTotals.Fields(&quot;6&quot;),0) %></td>
		<td><% = FormatNumber(rstCollectorTotals.Fields(&quot;7&quot;),0) %></td>
		<td><% = FormatNumber(rstCollectorTotals.Fields(&quot;8&quot;),0) %></td>
		<td><% = FormatNumber(rstCollectorTotals.Fields(&quot;9&quot;),0) %></td>
		<td><% = FormatNumber(rstCollectorTotals.Fields(&quot;10&quot;),0) %></td>
		<td><% = FormatNumber(rstCollectorTotals.Fields(&quot;11&quot;),0) %></td>
		<td><% = FormatNumber(rstCollectorTotals.Fields(&quot;12&quot;),0) %></td>
		<td><% = FormatNumber(rstCollectorTotals.Fields(&quot;13&quot;),0) %></td>
		<td><% = FormatNumber(rstCollectorTotals.Fields(&quot;14&quot;),0) %></td>
		<td><% = FormatNumber(rstCollectorTotals.Fields(&quot;15&quot;),0) %></td>
		<td><% = FormatNumber(rstCollectorTotals.Fields(&quot;16&quot;),0) %></td>
		<td><% = FormatNumber(rstCollectorTotals.Fields(&quot;17&quot;),0) %></td>
		<td><% = FormatNumber(rstCollectorTotals.Fields(&quot;18&quot;),0) %></td>
		<td><% = FormatNumber(rstCollectorTotals.Fields(&quot;19&quot;),0) %></td>
		<td><% = FormatNumber(rstCollectorTotals.Fields(&quot;20&quot;),0) %></td>
	</tr>
	
<%
rstCollectorTotals.MoveNext
loop
%>

	<tr bgcolor=white><td Colspan=25> </td></tr>

	<tr bgcolor=#99ccff>
		<td id=&quot;SiteBody&quot;> </td>
		<td id=&quot;BucketBody&quot;> </td>
		<td id=&quot;SupervisorBody&quot;> </td>
		<td id=&quot;CollectorBody&quot;><b>Totals</b></td>
		<td id=&quot;TotalBody&quot;> <% = FormatNumber(rstCollectorTotalsSum.Fields(&quot;Total&quot;),0) %> </td>
		<td id=&quot;OneBody&quot;> <% = FormatNumber(rstCollectorTotalsSum.Fields(&quot;1&quot;),0) %> </td>
		<td id=&quot;TwoBody&quot;> <% = FormatNumber(rstCollectorTotalsSum.Fields(&quot;2&quot;),0) %> </td>
		<td id=&quot;ThreeBody&quot;> <% = FormatNumber(rstCollectorTotalsSum.Fields(&quot;3&quot;),0) %> </td>
		<td id=&quot;FourBody&quot;> <% = FormatNumber(rstCollectorTotalsSum.Fields(&quot;4&quot;),0) %> </td>
		<td id=&quot;FiveBody&quot;> <% = FormatNumber(rstCollectorTotalsSum.Fields(&quot;5&quot;),0) %> </td>
		<td id=&quot;SixBody&quot;> <% = FormatNumber(rstCollectorTotalsSum.Fields(&quot;6&quot;),0) %> </td>
		<td id=&quot;SevenBody&quot;> <% = FormatNumber(rstCollectorTotalsSum.Fields(&quot;7&quot;),0) %> </td>
		<td id=&quot;EightBody&quot;> <% = FormatNumber(rstCollectorTotalsSum.Fields(&quot;8&quot;),0) %> </td>
		<td id=&quot;NineBody&quot;> <% = FormatNumber(rstCollectorTotalsSum.Fields(&quot;9&quot;),0) %> </td>
		<td id=&quot;TenBody&quot;> <% = FormatNumber(rstCollectorTotalsSum.Fields(&quot;10&quot;),0) %> </td>
		<td id=&quot;ElevenBody&quot;> <% = FormatNumber(rstCollectorTotalsSum.Fields(&quot;11&quot;),0) %> </td>
		<td id=&quot;TwelveBody&quot;> <% = FormatNumber(rstCollectorTotalsSum.Fields(&quot;12&quot;),0) %> </td>
		<td id=&quot;ThirteenBody&quot;> <% = FormatNumber(rstCollectorTotalsSum.Fields(&quot;13&quot;),0) %> </td>
		<td id=&quot;FourteenBody&quot;> <% = FormatNumber(rstCollectorTotalsSum.Fields(&quot;14&quot;),0) %> </td>
		<td id=&quot;FifteenBody&quot;> <% = FormatNumber(rstCollectorTotalsSum.Fields(&quot;15&quot;),0) %> </td>
		<td id=&quot;SixteenBody&quot;> <% = FormatNumber(rstCollectorTotalsSum.Fields(&quot;16&quot;),0) %> </td>
		<td id=&quot;SeventeenBody&quot;> <% = FormatNumber(rstCollectorTotalsSum.Fields(&quot;17&quot;),0) %> </td>
		<td id=&quot;EighteenBody&quot;> <% = FormatNumber(rstCollectorTotalsSum.Fields(&quot;18&quot;),0) %> </td>
		<td id=&quot;NineteenBody&quot;> <% = FormatNumber(rstCollectorTotalsSum.Fields(&quot;19&quot;),0) %> </td>
		<td id=&quot;TwentyBody&quot;> <% = FormatNumber(rstCollectorTotalsSum.Fields(&quot;20&quot;),0) %> </td>
	</tr>
</Table>
</Div>

<%

rstCollectorTotals.Close
rstCollectorTotalsSum.Close
Set rstCollectorTotals = Nothing
Set rstCollectorTotalsSum = Nothing
objDB.Close
Set objDB = Nothing

%>



</BODY>
</HTML>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top