PDA

View Full Version : Printing Data in HTML Table format


kuchiv
01-07-2003, 08:59 AM
I am extracting data from SQL database. Once the data is extracted, then I am put in the form of a HTML table format. The output that I desire to generate from the recordset should look like this:

Company1 Issue1
(Link to Company details) (Link to Complaints file)
Issue2
Issue3

Company2 Issue1
(Link to Company details) (Link to Complaints file)
Issue2
Issue3

Company3 Issue1
(Link to Company details) (Link to Complaints file)
Issue2
Issue3

Means the company should be grouped and the list of issues for a company are displayed.

what logic do I use to generate it?.

I have used the following loop, but its displaying only one company and going to end of file.

while not rs.eof
str = dt("revrec_itemcode")
%>
<td class="evenrow" COLSPAN=2 width="5%">
<%=start%>
<td class="evenrow" colspan=4 width="5%"><a HREF="QCustomerDetail.asp?<%=ExtraStr%>&ccode=<%=common.ConvertSpecialCharacters(dt("revrec_itemcode"))%>"><%=dt("revrec_itemcode")%></a></td>
<td class="evenrow" colspan=4 width="5%"><%=dt("cust_name")%></td>
<td class="evenrow" colspan=4 width="5%"><%=dt("cust_contact_name")%></td>
<td class="evenrow" colspan=2 width="5%"><%=dt("cust_phone")%></td>
<td class="evenrow" colspan=2 width="5%"><%=dt("cust_fax")%></td>
<td class="evenrow" align="center" colspan=2 width="5%"><center><input type="checkbox" id="chkd" name="chkd" value="<%=common.ConvertSpecialCharacters(sid)%>"></center></td>
<%'dt.MoveNext
'dt.MoveFirst

do while not dt.EOF
%>
<td class="evenrow" colspan=2 width="5%"><a href="QCustomerCalls.asp">Issue <%=start%></a><%start = start + 1
%>
</td>
<%Response.Write dt.CursorLocation
dt.MoveNext
loop
'Response.Write dt.CursorLocation
wend
%>

how do i do it then?