If you use ASP, ADO and SQL Server, check out my new article at:
http://weblogs.sqlteam.com/jeffs/posts/526.aspx
It includes code for a VBScript class which makes writing HTML reports based on an ADO recordset with group headers, footers, and subtotals extremely easy. The class uses the GetRows() method of ADO which also makes it quite efficient.