Seperating a Table by Category.
Question posted by:
GazMathias (Member) on October 8th, 2008 02:18 PM
Hi all,
I am writing a page for our intranet that lists useful office documents / dashboards. At the moment I am simply just looping the recordset into a table.
I would like to add a bit of seperation to the table, using the document's category, of the format:
Category Name or Pic
|Table | Table | Table|
Category Name or Pic
|Table | Table | Table|
Etc.
Gaz
2 Answers Posted
It would help if I could see the loop you have set up now that writes out your table.
Offhand you will need something to be able to check these categories your talking about.
Are all the documents named a certain way? Are the documents separated by folders that also represent these categories?
If either of those are true you should be able to do what you want with some checks on those properties.
Select Case fso.FolderName Case "MyCategory" 'place these files into an array to print out this table Case "MyCategory2" 'place these files into an array to print out this table End Select
This is a very quick general example (honestly im not even sure if the FSO syntax is right ;) but it should give you an idea.
Hi,
Thanks for the reply.
I am not using the filesystem to find the documents, as they are stored in such a wide range of directories, and moving them to one place would be impractical.
Everything is read from a database that the users manage through the site itself.
I got there in the end:
First, I added an ORDER BY Category clause to the sql statment.
I then used a loop structured like the following:
<% Dim cat cat ="" Do While Not RS.EOF If Not Cat = RS("Category") Then %> <Row to output if category header> <% cat = RS("Category") End IF %> <rows containing document info> <% RS.Movenext Loop %>
Hopefully, that will be of some use to someone else!
Gaz
What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over
196,220 network members.
You are viewing a mobilized version of this site...
View original page here