navigation
Thomas Brunt's OutFront Hosting
 
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Microsoft MVP

Spooky's Databases > Advanced > DRW > Grouping Records


.When the DRW displays records in a table format, there is no setting that allows a heading for each "type" of record.

For example, the default display of data looks like this :

RecordID RecordName RecordType
1 Apple Fruit
2 Banana Fruit
3 Pear Fruit
4 Leek Vegetable
5 Beetroot Vegetable
6 Bean Vegetable
7 Steak Meat
8 Pork Meat

If you wish to provide a heading for each Record type as below, then there is a simple method of doing so.

RecordID RecordName RecordType
Fruit
1 Apple Fruit
2 Banana Fruit
3 Pear Fruit
Vegetable
4 Leek Vegetable
5 Beetroot Vegetable
6 Bean Vegetable
Meat
7 Steak Meat
8 Pork Meat

Create your database using the connection that contains your data.

You'll want to "order" your data by the column name you wish to group by.
This is done at step 3 of the DRW > more options > Order

Finish creating the DRW with the wizard as normal using 'table' as the formatting type.


Now, switch to code view and locate this code (it will differ slightly with each DRW) :

<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="556" --><tr>
      <td>

Add the new code in red below (if you are cutting and pasting, be sure to paste to notepad first as you want unformatted text)

<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="556" --><tr>

<%
DIM GroupName,tmpGroupName
GroupName=FP_FieldVal(fp_rs,"GroupValue")
If GroupName <> tmpGroupName then
tmpGroupName=GroupName
%>
<td colspan=5><%=tmpGroupName%>&nbsp;</td>
</tr>
<tr>
<%end if%>

      <td>

Note : "GroupValue" is YOUR column name and colspan MUST equal the number of columns of data you are displaying.


 


Microsoft Corporation in no way endorses or is affiliated with "OutFront." 
OutFront is published and edited by Thomas Brunt
440 Great Circle Dr., St. Matthews, SC 29135.  803-655-6151
© 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 All Rights Reserved
Click here to view our privacy statement.