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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Really need help. Table Row Format 2

Status
Not open for further replies.

Corneliu

Technical User
Sep 16, 2002
141
US
I have been searching everywhere for this, and can't find nothing. Been thru the forums search, other sites, etc, nothing.

I need to display a table with 13 rows across and 52 down(kind of).
The number 52 is for the 52 Weeks in the year. What I have is a DB where we complete tickets/work orders. I want to display how many tickets/work orders each site completed per week, up to 52 weeks, even if the year is not completed yet. If the data is available until week 15, than for the rest display 0 tickets.
Want to loop thru the 52 records in the weeks DB and than if the record in the tickets table matches that week, display the Site_name and ticket count.
Here is how it is now:

Site1 Week 1 Showing 13 times the tickets for week 1.
Site1 Week 2 Same as above but week 2.
Up to end of the tickets DB records for Site1.
Than it goes to Site2.
Site2 Week 1 Showing 13 times the tickets for week 1.
Site2 Week 2 Same as above but for week 2.
Than next site, etc. I have 5 sites in total.

Here is the code:
<table width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;1&quot; bgcolor=&quot;#6B8EB5&quot;>
<% While NOT RS.EOF %>
<tr bgcolor=&quot;#FFFFFF&quot;>
<td bgcolor=&quot;#6B8EB5&quot; nowrap><%=RS(&quot;Site_Name&quot;)%></td>
<td>Week <%=RS(&quot;Week&quot;)%></td>
<% For i=1 to 13 %>
<td nowrap><%=RS(&quot;Ticket_Count&quot;) & &quot; Tkts&quot;%></td>
<% Next %>
</tr>
<% RS.MoveNext
WEND
%>
</table>

What I would LIKE if possible, is this:

Site Name Week1 Week2 so on to Week13
Site1 13 tickets 15 tickets 20 tickets
Site2 13 tickets 20 tickets 18 tickets

So On until all the Sites have been finished for the first 13 weeks.
Than, continue again with Week 14 thru 26.
Than, continue again with Week 26 thru 38.
Etc, etc.

ANYONE PLEASE CAN HELP ME WITH THIS? Been trying for many days now. I have 4-5 different ways I tried to format the table, but no matter what it will not work.

PLEASE. THANK YOU...
 
This will work if each site has an ticket entry for the same week. ex they all have a week 4 entry.

<%
sDBName = &quot;DRIVER={Microsoft Access Driver (*.mdb)};&quot; & &quot;DBQ=&quot; & Server.MapPath(&quot;db.mdb&quot;)
Set objDB = Server.CreateObject(&quot;ADODB.Connection&quot;)
objDB.Open sDBName

dim html, tmp, cnt, max, sql
tmp = html = &quot;&quot;

sql = &quot;select max(week) as maxweek from table1&quot;
Set objRS = objDB.Execute(sql)
max = objRS(&quot;maxweek&quot;)

sql = &quot;select * from table1 order by site, week&quot;
Set objRS = objDB.Execute(sql)

html = html & &quot;<table border=1>&quot;
html = html & &quot;<tr>&quot;
html = html & &quot;<td>Site Name</td>&quot;

For cnt = 1 to 13
html = html & &quot;<td>Week &quot; & cnt & &quot;</td>&quot;
next

html = html & &quot;</tr>&quot;

do while NOT objRS.EOF
if tmp <> objRS(&quot;site&quot;) then
tmp = objRS(&quot;site&quot;)
html = html & &quot;<tr>&quot;
html = html & &quot;<td>&quot; & objRS(&quot;site&quot;) & &quot;</td>&quot;
end if
html = html & &quot;<td align=center>&quot; & objRS(&quot;tickets&quot;) & &quot;</td>&quot;

objRS.MoveNext

if NOT objRS.EOF Then
if tmp <> objRS(&quot;site&quot;) then
For cnt = 1 to (13 - max)
html = html & &quot;<td align=center>0</td>&quot;
next
end if
end if
loop

For cnt = 1 to (13 - max)
html = html & &quot;<td align=center>0</td>&quot;
next

html = html & &quot;</tr>&quot;
html = html & &quot;</table>&quot;

response.write html
%>
 
I would create an array the size of your proposed table and go from there. Your select statement could be along the lines of: (Note: this may not match your db exactly)
Select Count(ticket_id) as numtickets, week, site From Table Group By site, week Order By site, week

If you only have a date in the tickets db, rather than a week number it would be more complicated because you would need to find out which week the ticket belongs to, but this could be done from the code. (DateDiff function and a little division)

In order to fill the array you would want to do something along the lines of:
Code:
Dim lastSite
Dim arrTickets(14,52)  'arrTicket(x,0) will hold site name

Do Until rs.EOF
   'if the currently queued site name doesn't match the current row in the array
   If rs(&quot;site&quot;) <> arrTickets(lastSite,0) Then
      'incrememnt the site we're working on
      lastSite = lastSite + 1
      'add this new sitename to the top of the array
      arrTickets(lastSite,0) = rs(&quot;site&quot;)
   End If

   'set ticket number for the week for the current site we're working on
   '   if we were doing this by dates instead we would only increment this array entry instead of setting it
   arrTickets(lastSite,rs(&quot;week&quot;)) = rs(&quot;numtickets&quot;)
   rs.MoveNext
Loop

That should fill the array from the recordset, then all you would need to do is display it:
Code:
Dim i, j
Response.Write &quot;<table>&quot;

'output headers
Response.Write &quot;<tr><th>Site</th>&quot;
For j = 1 to 52
   Response.Write &quot;<th>Week #&quot; & j & &quot;</th>&quot;
Next
Response.Write &quot;</tr>&quot;

'output array of data
For i = 0 to 14
   Response.Write &quot;<tr>&quot;
   For j = 0 to 52
      Response.Write &quot;<td>&quot; & arrTickets(i,j) & &quot;</td>&quot;
   Next
Next

Response.Write &quot;</table>&quot;

And that should display everything. I hope this helps,

-Tarwn

01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101
29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
Tarwn, I want to THANK YOU VERY MUCH. It works really good. I just wanted one change if possible. This is where I got stuck before when trying to get certain number of columns across. The table displays good, but it prints out 52 columns across the screen, which makes the screen scroll to the side like crazy lol.
Is it possible to make the tables columns to go Week 13 and than return and print out the next 13 columns, break and the next 13 columns, etc?
This way all the data can fit on a 1024X768 Res.
Here is the code. I just changed this &quot;For i = 0 to 5&quot;. When I have it &quot;For i = 0 to 14&quot; it prints out 14 rows down.

Right now is this:
Site Week 1 - Week 52
Data

If possible, would like to display 13 columns across and than break and start over again with new data.
Site Week 1 - Week 13
Data
Site Week 14 - Week 26
Data
etc.

Here it is. I included the Query in case you wanted to see it.

<%
Dim RS
Dim RS_numRows

Set RS = Server.CreateObject(&quot;ADODB.Recordset&quot;)
RS.ActiveConnection = MM_ReportsRemote_STRING
RS.Source = &quot;SELECT SUM(TicketCount) as Ticket_Count, Tickets.Site, Sites.SiteName as Site_Name, Tickets.Week FROM Tickets INNER JOIN Sites ON Tickets.Site = Sites.SiteID WHERE Tickets.TYear = '&quot; & Year(Now) & &quot;' GROUP by Tickets.Week, Sites.SiteName, Tickets.Site Order By Tickets.Site ASC &quot;
RS.CursorType = 3
RS.CursorLocation = 3
RS.LockType = 1
RS.Open()

RS_numRows = 0
%>

<%
Dim lastSite
Dim arrTickets(14,52) 'arrTicket(x,0) will hold site name

Do Until RS.EOF
'if the currently queued site name doesn't match the current row in the array
If RS(&quot;Site_Name&quot;) <> arrTickets(lastSite,0) Then
'incrememnt the site we're working on
lastSite = lastSite + 1
'add this new sitename to the top of the array
arrTickets(lastSite,0) = RS(&quot;Site_Name&quot;)
End If

'set ticket number for the week for the current site we're working on
' if we were doing this by dates instead we would only increment this array entry instead of setting it
arrTickets(lastSite,RS(&quot;Week&quot;)) = rs(&quot;Ticket_Count&quot;)
RS.MoveNext
Loop

'That should fill the array from the recordset, then all you would need to do is display it:
'Dim i, j
Response.Write &quot;<table width=100% border=0 cellpadding=0 cellspacing=1 bgcolor=6B8EB5 class=menu>&quot;

'output headers
Response.Write &quot;<tr><th>Site</th>&quot;
For j = 1 to 52
Response.Write &quot;<th>Week #&quot; & j & &quot;</th>&quot;
Next
Response.Write &quot;</tr>&quot;

'output array of data
For i = 0 to 5
Response.Write &quot;<tr>&quot;
For j = 0 to 52
Response.Write &quot;<td bgcolor=FFFFFF>&quot; & arrTickets(i,j) & &quot;</td>&quot;
Next
Next

Response.Write &quot;</table>&quot;
%>


Tarwn, I REALLY WANT TO THANK YOU VERY MUCH. THIS HAS SAVED ME WEEKS OF WORK.
Chris5g, thank you for your help too, I appreciate it.
 
Tarwn, I got around the problem with displaying more than 13 columns across.I basically used 2 queries (no problem), and copy the table over again (kind of like 2 tables, but different variables). Just one question.
The data outputs fine, but the second table DOES NOT output the Site Name. Can you tell me why the Site Name does not show up?
I included both the first and second table.

AGAIN THANK YOU...

First Table: Displays without any problems.
<%
Dim lastSite
Dim arrTickets(13,17) 'arrTicket(x,0) will hold site name

Do Until RS.EOF
'if the currently queued site name doesn't match the current row in the array
If RS(&quot;Site_Name&quot;) <> arrTickets(lastSite,0) Then
'incrememnt the site we're working on
lastSite = lastSite + 1
'add this new sitename to the top of the array
arrTickets(lastSite,0) = RS(&quot;Site_Name&quot;)
End If

'set ticket number for the week for the current site we're working on
' if we were doing this by dates instead we would only increment this array entry instead of setting it
arrTickets(lastSite,RS(&quot;Week&quot;)) = rs(&quot;Ticket_Count&quot;)
RS.MoveNext
Loop

'That should fill the array from the recordset, then all you would need to do is display it:
'Dim i, j
Response.Write &quot;<table width=100% border=0 cellpadding=0 cellspacing=1 bgcolor=6B8EB5 class=menu>&quot;

'output headers
Response.Write &quot;<tr><th>Site</th>&quot;
For j = 1 to 13
Response.Write &quot;<th nowrap>&quot; & &quot;<span class=heading2white>&quot; & &quot;Week #&quot; & j & &quot;</span>&quot; & &quot;</th>&quot;
Next
Response.Write &quot;</tr>&quot;

'output array of data
For i = 0 to 5
Response.Write &quot;<tr>&quot;
For j = 0 to 13
Response.Write &quot;<td bgcolor=FFFFFF align=center>&quot; & arrTickets(i,j) & &quot;</td>&quot;
Next
Next

Response.Write &quot;</table>&quot;
%>

The Second table where the Site Name DOES NOT show up.

<br>


<%
Dim lastSite1
Dim arrTickets1(14,26) 'arrTicket(x,0) will hold site name

Do Until RS1.EOF
'if the currently queued site name doesn't match the current row in the array
If RS1(&quot;Site_Name&quot;) <> arrTickets1(lastSite1,0) Then
'incrememnt the site we're working on
lastSite1 = lastSite1 + 1
'add this new sitename to the top of the array
arrTickets1(lastSite1,0) = RS1(&quot;Site_Name&quot;)
End If

'set ticket number for the week for the current site we're working on
' if we were doing this by dates instead we would only increment this array entry instead of setting it
arrTickets1(lastSite1,RS1(&quot;Week&quot;)) = RS1(&quot;Ticket_Count&quot;)
RS1.MoveNext
Loop

'That should fill the array from the recordset, then all you would need to do is display it:
Dim a, b
Response.Write &quot;<table width=100% border=0 cellpadding=0 cellspacing=1 bgcolor=6B8EB5 class=menu>&quot;

'output headers
Response.Write &quot;<tr><th>Site</th>&quot;
For a = 13 to 26
Response.Write &quot;<th nowrap>&quot; & &quot;<span class=heading2white>&quot; & &quot;Week #&quot; & a & &quot;</span>&quot; & &quot;</th>&quot;
Next
Response.Write &quot;</tr>&quot;

'output array of data
For b = 0 to 5
Response.Write &quot;<tr>&quot;
For a = 13 to 26
Response.Write &quot;<td bgcolor=FFFFFF align=center>&quot; & arrTickets1(b,a) & &quot;</td>&quot;
Next
Next

Response.Write &quot;</table>&quot;
%>

I get the proper column count, but the site name does not show up. Maybe I did not make the array properly.

THANK YOU...
 
The sitename is being stored in the very first space in the aray, ie: arrTickets(siteNum, 0)

So in the second table when you loop from weeks 13 to 26 you don't get the sitename again because your not printing out 0.

As a sidenote, I missed an end row in my first post:
Code:
'output array of data
For i = 0 to 5
   Response.Write &quot;<tr>&quot;
   For j = 0 to 52
      Response.Write &quot;<td bgcolor=FFFFFF>&quot; & arrTickets(i,j) & &quot;</td>&quot;
   Next
   Response.Write &quot;</tr>&quot;
'oops, I missed this earlier
Code:
Next

Rather than make another query, you could simply reuse tha array as you started to do in the second to last post. All of the data has already been placed in the array, you simply need to break up the For j = 0 to 52 into multiple sections, like so:
Code:
'output headers
Response.Write &quot;<tr><th>Site</th>&quot;
For j = 1 to 13
   Response.Write &quot;<th>Week #&quot; & j & &quot;</th>&quot;
Next
Response.Write &quot;</tr>&quot;

'output array of data
For i = 0 to 5
   Response.Write &quot;<tr>&quot;
   For j = 0 to 13  'display only 13 columns here
      Response.Write &quot;<td bgcolor=FFFFFF>&quot; & arrTickets(i,j) & &quot;</td>&quot;
   Response.Write &quot;</tr>&quot;
   Next
Next

Response.Write &quot;<tr><td colspan=&quot;&quot;14&quot;&quot;> </td></tr>&quot; 'blank row


'output headers
Response.Write &quot;<tr><th>Site</th>&quot;
For j = 14 to 26
   Response.Write &quot;<th>Week #&quot; & j & &quot;</th>&quot;
   'etc

Now this will get a little messy because your going to end up repeating that same chunk of code over and over. There are two solutions to this:
1) Make a function that accepts two week numbers and outputs the html for that range, or
2) Rewrite this as a While loop with a ctr that will count the number of weeks you add, then if that counter mod 13 = 0, end the row, start a new row, show the headers/etc again, and continue

1 shouldn't be to hard:
Code:
Function OutputSection(startWk, endWk)
'output headers
Response.Write &quot;<tr><th>Site</th>&quot;
For j = 1 to 13
   Response.Write &quot;<th>Week #&quot; & j & &quot;</th>&quot;
Next
Response.Write &quot;</tr>&quot;


'output array of data
For i = 0 to 5
   Response.Write &quot;<tr>&quot;
   'output the sitenames:
   Response.Write &quot;<td>&quot; & arrTickets(i,0) & &quot;</td>&quot;
   For j = startWk to endWk
      Response.Write &quot;<td bgcolor=FFFFFF>&quot; & arrTickets(i,j) & &quot;</td>&quot;
   Next
   Response.Write &quot;</tr>&quot;
Next
End Function

'then where you had this section earlier in your code you simply call the function a few times:
OutputSection(1,13)
OutputSection(14,26)
OutputSection(27,30)
OutputSection(31,44)
OutputSection(45,52)


Now the other method requires rewriting our loop, something I don't have the energy for after 10.5 hours at work. Let me know if your (or anyone else) is interested in pursuing that course and I will give it a wing...

-Tarwn

01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101
29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
Tarwn, again I want to thank you for your help VERY MUCH.
I took your suggestion and just used 1 query. I got all 52 weeks to print out with no problem. I know that i asked you why the site name does not show up, and kind of figure it out after I posted the question.
This time I used your suggestion used the array to separate the weeks, but again the Site Name does not show up after the first 13 columns.
For the second set of data I do not put the arrTickets(lastSite,0) no more because I take it is not needed.
Can you tell me why the Site Name does not show up?
The code for all 52 weeks, with the repeated array 1-13, 14-26, 27-39, 40-52.

Maybe I did not write it correct.
<%
Dim lastSite
Dim arrTickets(20,52) 'arrTicket(x,0) will hold site name

Do Until RS.EOF
'if the currently queued site name doesn't match the current row in the array
If RS(&quot;Site_Name&quot;) <> arrTickets(lastSite,0) Then
'incrememnt the site we're working on
lastSite = lastSite + 1
'add this new sitename to the top of the array
arrTickets(lastSite,0) = RS(&quot;Site_Name&quot;)
End If

'set ticket number for the week for the current site we're working on
' if we were doing this by dates instead we would only increment this array entry instead of setting it
arrTickets(lastSite,RS(&quot;Week&quot;)) = rs(&quot;Ticket_Count&quot;)
RS.MoveNext
Loop

'That should fill the array from the recordset, then all you would need to do is display it:
'Dim i, j
Response.Write &quot;<table width=100% border=0 cellpadding=0 cellspacing=1 bgcolor=6B8EB5 class=menu>&quot;

'output headers
Response.Write &quot;<tr><th>Site</th>&quot;
For j = 1 to 13
Response.Write &quot;<th nowrap>&quot; & &quot;<span class=heading2white>&quot; & &quot;Week #&quot; & j & &quot;</span>&quot; & &quot;</th>&quot;
Next
Response.Write &quot;</tr>&quot;

'output array of data
For i = 0 to 5
Response.Write &quot;<tr>&quot;
For j = 0 to 13
Response.Write &quot;<td bgcolor=FFFFFF align=center>&quot; & arrTickets(i,j) & &quot;</td>&quot;
Next
Response.Write &quot;</tr>&quot;
Next

'------------------------------------------------------------------------------------------------------------
Response.Write &quot;<tr><td colspan=&quot;&quot;14&quot;&quot; bgcolor=FFFFFF>_</td></tr>&quot; 'blank row
'------------------------------------------------------------------------------------------------------------

'That should fill the array from the recordset, then all you would need to do is display it:
'Dim i, j
Response.Write &quot;<table width=100% border=0 cellpadding=0 cellspacing=1 bgcolor=6B8EB5 class=menu>&quot;

'output headers
Response.Write &quot;<tr><th>Site</th>&quot;
For j = 14 to 26
Response.Write &quot;<th nowrap>&quot; & &quot;<span class=heading2white>&quot; & &quot;Week #&quot; & j & &quot;</span>&quot; & &quot;</th>&quot;
Next
Response.Write &quot;</tr>&quot;

'output array of data
For i = 0 to 5
Response.Write &quot;<tr>&quot;
For j = 14 to 26
Response.Write &quot;<td bgcolor=FFFFFF align=center>&quot; & arrTickets(i,j) & &quot;</td>&quot;
Next
Response.Write &quot;</tr>&quot;
Next

'------------------------------------------------------------------------------------------------------------
Response.Write &quot;<tr><td colspan=&quot;&quot;14&quot;&quot; bgcolor=FFFFFF>_</td></tr>&quot; 'blank row
'------------------------------------------------------------------------------------------------------------

'That should fill the array from the recordset, then all you would need to do is display it:
'Dim i, j
Response.Write &quot;<table width=100% border=0 cellpadding=0 cellspacing=1 bgcolor=6B8EB5 class=menu>&quot;

'output headers
Response.Write &quot;<tr><th>Site</th>&quot;
For j = 27 to 39
Response.Write &quot;<th nowrap>&quot; & &quot;<span class=heading2white>&quot; & &quot;Week #&quot; & j & &quot;</span>&quot; & &quot;</th>&quot;
Next
Response.Write &quot;</tr>&quot;

'output array of data
For i = 0 to 5
Response.Write &quot;<tr>&quot;
For j = 27 to 39
Response.Write &quot;<td bgcolor=FFFFFF align=center>&quot; & arrTickets(i,j) & &quot;</td>&quot;
Next
Response.Write &quot;</tr>&quot;
Next

'------------------------------------------------------------------------------------------------------------
Response.Write &quot;<tr><td colspan=&quot;&quot;14&quot;&quot; bgcolor=FFFFFF>_</td></tr>&quot; 'blank row
'------------------------------------------------------------------------------------------------------------

'That should fill the array from the recordset, then all you would need to do is display it:
'Dim i, j
Response.Write &quot;<table width=100% border=0 cellpadding=0 cellspacing=1 bgcolor=6B8EB5 class=menu>&quot;

'output headers
Response.Write &quot;<tr><th>Site</th>&quot;
For j = 40 to 52
Response.Write &quot;<th nowrap>&quot; & &quot;<span class=heading2white>&quot; & &quot;Week #&quot; & j & &quot;</span>&quot; & &quot;</th>&quot;
Next
Response.Write &quot;</tr>&quot;

'output array of data
For i = 0 to 5
Response.Write &quot;<tr>&quot;
For j = 40 to 52
Response.Write &quot;<td bgcolor=FFFFFF align=center>&quot; & arrTickets(i,j) & &quot;</td>&quot;
Next
Response.Write &quot;</tr>&quot;
Next
Response.Write &quot;</table>&quot;
%>

AGAIN THANK YOU for your help. This really helped me a great deal.
THANK YOU...
 
Tarwn, I looked thru the options and I started messing around with the Function version you gave me.
The site names now comes up, the data is good, but the week #s are the same thru a 13 week cycle.
Just when I thought I had it finished, another problem, lol.
The weeks for each row are the same number.
There are 4 rows with 13 columns. Each columns displays the week #1-13 but the next row gives me the same number.

Right Now:
Site Week 1 Week13
Site1 data data
...
Site Week 1 Week13
Site1 data data
...
Site Week 1 Week13
Site1 data data
...
Site Week 1 Week13
Site1 data data
...

At this time the week should go from 14-26
Well, the data is, but the week #s are not. It shows the same Week #1-13.
Any idea why this is?

Should be:
Site Week 1 Week13
Site1 data data
...
Site Week 14 Week26
Site1 data data
...
Site Week 27 Week39
Site1 data data
...
Site Week 40 Week52
Site1 data data
...


The data is fine, it prints out the proper #s, but not the week #s.
This is with the function version. The Code:
<%
Dim startWk
Dim endWk
startWk = 1
endWek = 52
Dim lastSite
Dim arrTickets(5,52) 'arrTicket(x,0) will hold site name

Do Until RS.EOF
'if the currently queued site name doesn't match the current row in the array
If RS(&quot;Site_Name&quot;) <> arrTickets(lastSite,0) Then
'incrememnt the site we're working on
lastSite = lastSite + 1
'add this new sitename to the top of the array
arrTickets(lastSite,0) = RS(&quot;Site_Name&quot;)
End If

'set ticket number for the week for the current site we're working on
' if we were doing this by dates instead we would only increment this array entry instead of setting it
arrTickets(lastSite,RS(&quot;Week&quot;)) = rs(&quot;Ticket_Count&quot;)
RS.MoveNext
Loop

Function OutputSection(startWk, endWk)
Response.Write &quot;<table width=100% border=0 cellpadding=0 cellspacing=1 bgcolor=6B8EB5 class=menu>&quot;
'output headers
Response.Write &quot;<tr><th>Site</th>&quot;
For j = 1 to 13
Response.Write &quot;<th nowrap>&quot; & &quot;<span class=heading2white>&quot; & &quot;Week #&quot; & j & &quot;</span>&quot; & &quot;</th>&quot;
Next
Response.Write &quot;</tr>&quot;


'output array of data
For i = 0 to 5
Response.Write &quot;<tr>&quot;
'output the sitenames:
Response.Write &quot;<td>&quot; & &quot;<span class=heading2white>&quot; & &quot;<div align=left>&quot; & arrTickets(i,0) & &quot;</div>&quot; & &quot;</span>&quot; & &quot;</td>&quot;
For j = startWk to endWk
Response.Write &quot;<td bgcolor=FFFFFF>&quot; & &quot;<div align=center>&quot; & arrTickets(i,j) & &quot;</div>&quot; & &quot;</td>&quot;
Next
Response.Write &quot;</tr>&quot;
Next
Response.Write &quot;</table>&quot;
End Function

Call OutputSection(1,13)
Call OutputSection(14,26)
Call OutputSection(27,39)
Call OutputSection(40,52)

%>
 
The problem is the hardcoded numbers in the wek output section of the function:
Code:
Function OutputSection(startWk, endWk)
Response.Write &quot;<table width=100% border=0 cellpadding=0 cellspacing=1 bgcolor=6B8EB5 class=menu>&quot;
'output headers
Response.Write &quot;<tr><th>Site</th>&quot;
For j = 1 to 13
&gt;---

If you replace the 1 and 13 here with the startWk and endWk variables it will display that range instead of displaying 1-13 each time.

Sorry about that mistake, I typed that either late last night or early this morning, and I wasn't exactly at my most awake at either of those times :p

-Tarwn

01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101
29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
Ouch, I cannot believe it was that simple. I thought I looked thru the entire code, but guess I didnt do a good job.
THANK YOU THANK YOU THANK YOU.

You saved me weeks of work. I can take this and implement it for other categories along with work orders.

Tarwn, I want to thank you very much for your help. Again, you are the best.

THANK YOU...
THANK YOU...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top