Hello

I need to make some reports based on information from a database. I'm looking for some advice on the best way to construct the reports, contain the data, and output it. The output will be an xhtml table.

The simplest thing to do is to sort the information, then write each db row to a table row. But i need to display the data in such a way that a column with the same value doesn't repeat - it mentions the value once, then is blank underneath until the same column has a different value. Eg:

instead of:

Location | Attraction |
------------------------
Location A Attraction A
Location A Attraction B
Location C Attraction A
Location D Attraction A

It will be rendered as:

Location | Attraction
------------------------
Location A Attraction A
Attraction B (should appear under Attraction A, with the space underneath Location A blank - post formatting)
Location C Attraction A
Location D Attraction A

If anyone has done any vb programming, i suppose it would be the same in appearance to a hierarchical dataset. The above is a simplified example, as each column can be hierarchical.

So whats the best way of representing this data internally? Should i get it from the db, add it to an array that mimics the output structure, then render it? Should i just output the html directly from the db results? How would i map the db results to the output structure i need?

Cheers