473,753 Members | 7,291 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sorting output

I have a table of about 20 Categories. I currently have them displayed
accross the page in a table from left to right in 3 columns. like this:
abuse cmecf credit/etc
dismissal presumptions

You will notice the sort runs from left to right. I would like the sort to
run vertically like this:
abuse dismissal
cmecf presumptions
credit/etc

I am outputting from an access table into an html table via asp. Does
anyone have a trick to get the output the way I want it.
Could I populate an array and then output like this:

array(1) array(4) array(7)
array(2) array(5) array(8)

Any help is appreciated.

thanks
Milton
Jul 26 '05 #1
3 1315
"Milton Snider" wrote in message
news:OM******** ******@TK2MSFTN GP14.phx.gbl...
:I have a table of about 20 Categories. I currently have them displayed
: accross the page in a table from left to right in 3 columns. like this:
: abuse cmecf credit/etc
: dismissal presumptions
:
: You will notice the sort runs from left to right. I would like the sort
to
: run vertically like this:
: abuse dismissal
: cmecf presumptions
: credit/etc
:
: I am outputting from an access table into an html table via asp. Does
: anyone have a trick to get the output the way I want it.
: Could I populate an array and then output like this:
:
: array(1) array(4) array(7)
: array(2) array(5) array(8)

Assume rs is the recordset variable and arr is the 2-dimensional array
created using GetRows()

If you used GetRows, you can easily do this.

Const numColumns = 3
dim numRecords, arr, rowCounter, colCounter, displayName

' connect to database and return data

arr = rs.GetRows()

Response.Write "<table width=""100%""> "
numRecords = ubound(arr,2) + 1
if numRecords mod numColumns = 0 then
numRows = numRecords\numC olumns
Else
numRows = numRecords\numC olumns + 1
End if

For rowCounter = 1 to numRows
Response.Write "<tr>"
For colCounter = 0 to numColumns - 1
If rowCounter + colCounter * numRows <= numRecords then
displayName = arr(0, rowCounter + colCounter * numRows - 1)
Response.Write "<td style=""width: 33%"">" & arr(1, rowCounter +
colCounter * numRows - 1) & displayName & "</td>"
Else
Response.write "<td>&nbsp; </td>"
end if
Next
Response.Write "</tr>"
Next

I've done this with two columns. I've made some changes to work with 3 but
it's not tested.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 26 '05 #2
"Roland Hall" <nobody@nowhere > wrote in message
news:O5******** ******@TK2MSFTN GP12.phx.gbl...
"Milton Snider" wrote in message
news:OM******** ******@TK2MSFTN GP14.phx.gbl...
:I have a table of about 20 Categories. I currently have them displayed
: accross the page in a table from left to right in 3 columns. like this:
: abuse cmecf credit/etc
: dismissal presumptions
:
: You will notice the sort runs from left to right. I would like the sort
to
: run vertically like this:
: abuse dismissal
: cmecf presumptions
: credit/etc
:
: I am outputting from an access table into an html table via asp. Does
: anyone have a trick to get the output the way I want it.
: Could I populate an array and then output like this:
:
: array(1) array(4) array(7)
: array(2) array(5) array(8)

Assume rs is the recordset variable and arr is the 2-dimensional array
created using GetRows()

If you used GetRows, you can easily do this.

Const numColumns = 3
dim numRecords, arr, rowCounter, colCounter, displayName

' connect to database and return data

arr = rs.GetRows()

Response.Write "<table width=""100%""> "
numRecords = ubound(arr,2) + 1
if numRecords mod numColumns = 0 then
numRows = numRecords\numC olumns
Else
numRows = numRecords\numC olumns + 1
End if

For rowCounter = 1 to numRows
Response.Write "<tr>"
For colCounter = 0 to numColumns - 1
If rowCounter + colCounter * numRows <= numRecords then
displayName = arr(0, rowCounter + colCounter * numRows - 1)
Response.Write "<td style=""width: 33%"">" & arr(1, rowCounter +
colCounter * numRows - 1) & displayName & "</td>"
Else
Response.write "<td>&nbsp; </td>"
end if
Next
Response.Write "</tr>"
Next

I've done this with two columns. I've made some changes to work with 3
but
it's not tested.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation -
http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp

Jul 26 '05 #3
"Milton Snider" wrote in message
news:eg******** ******@tk2msftn gp13.phx.gbl...
: "Roland Hall" wrote in message
: news:O5******** ******@TK2MSFTN GP12.phx.gbl...
: > "Milton Snider" wrote in message
: > news:OM******** ******@TK2MSFTN GP14.phx.gbl...
: > :I have a table of about 20 Categories. I currently have them displayed
: > : accross the page in a table from left to right in 3 columns. like
this:
: > : abuse cmecf credit/etc
: > : dismissal presumptions
: > :
: > : You will notice the sort runs from left to right. I would like the
sort
: > to
: > : run vertically like this:
: > : abuse dismissal
: > : cmecf presumptions
: > : credit/etc
: > :
: > : I am outputting from an access table into an html table via asp. Does
: > : anyone have a trick to get the output the way I want it.
: > : Could I populate an array and then output like this:
: > :
: > : array(1) array(4) array(7)
: > : array(2) array(5) array(8)
: >
: > Assume rs is the recordset variable and arr is the 2-dimensional array
: > created using GetRows()
: >
: > If you used GetRows, you can easily do this.
: >
: > Const numColumns = 3
: > dim numRecords, arr, rowCounter, colCounter, displayName
: >
: > ' connect to database and return data
: >
: > arr = rs.GetRows()
: >
: > Response.Write "<table width=""100%""> "
: > numRecords = ubound(arr,2) + 1
: > if numRecords mod numColumns = 0 then
: > numRows = numRecords\numC olumns
: > Else
: > numRows = numRecords\numC olumns + 1
: > End if
: >
: > For rowCounter = 1 to numRows
: > Response.Write "<tr>"
: > For colCounter = 0 to numColumns - 1
: > If rowCounter + colCounter * numRows <= numRecords then
: > displayName = arr(0, rowCounter + colCounter * numRows - 1)
: > Response.Write "<td style=""width: 33%"">" & arr(1, rowCounter +
: > colCounter * numRows - 1) & displayName & "</td>"
: > Else
: > Response.write "<td>&nbsp; </td>"
: > end if
: > Next
: > Response.Write "</tr>"
: > Next
: >
: > I've done this with two columns. I've made some changes to work with 3
: > but
: > it's not tested.

I got the idea a long time ago from a guy name Pete Draigh @
businessstrateg y.com

Glad it worked for you.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 26 '05 #4

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

Similar topics

9
3626
by: p0wer | last post by:
Let's suppose I have this sample document: <root> <entry id="1" <date>2003-08-03</date> <param_1>5</param_1> <param_2>10</param_2> </entry> <entry id="2"> ...
8
3537
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At the moment the printed output is usually going to Word. It's turning into an unholy mess, because I'm having to prepare umpteen different Word templates, and the queries that drive them, depending on what events a course has.
3
7342
KevinADC
by: KevinADC | last post by:
If you are entirely unfamiliar with using Perl to sort data, read the "Sorting Data with Perl - Part One and Two" articles before reading this article. Beginning Perl coders may find this article uses unfamiliar terms and syntax. Intermediate and advanced Perl coders should find this article useful. The object of the article is to inform the reader, it is not about how to code Perl or how to write good Perl code, but to teach the Schwartzian...
2
2261
by: Bob Laubla | last post by:
Hello I have a very complex maketable query with many records and involving multiple VB functions which call other functions. I need this table to be sorted by the first field. But no matter what I do, there is a small chance of the table coming out unsorted. I have tried sorting it with the 'make table' query. I have tried sorting it with Word during output (my current configuration runs 4 of these). I have tried reading it into an...
1
1288
by: LittlBUGer | last post by:
Hello. First of all I'm programming in VB.NET/ASP.NET doing a page for a website. Now, to my question.... I have a simple array of integer numbers (15 characters in length) which can hold up to 2000 items. What I basically need to do is output these numbers to a PDF file I'm creating on the fly and I can only fit a certain amount of numbers per page. What I need to do is just output these on each page in numerical order vertically NOT...
0
8896
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9653
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
9451
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
6869
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
6151
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
4771
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...
0
4942
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3395
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
3
2284
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.