hello all,
I am trying to create a report in asp, in order to do this I am using multiple record sets.
I want my data to look like :
Area : UK
County : Powys
name Tel Fax
Bob 123443 123456
james 11111 111112
County : Gwent
name tel fax
steve 123232 123122
jane 121111 232111
and so on, for differnt areas and differnt countys.
problem is, I can't get the format of the :
name tel fax
part to work correctly. so far it looks like
name tel fax
bob 121232 12332
name tel fax
james 111111 111112
how can I only have the Table headings to only appear once per county ?
full code is :
<%
GeoSQL = "SELECT * FROM GeographicalAreas ORDER BY GeographicalAreaDesc"
Set GeoRS = Conn.Execute( GeoSQL )
EstTypeSQL = "SELECT * FROM EstablishmentTypes ORDER BY EstablishmentTypeDesc"
Set EstTypeRS = Conn.Execute( EstTypeSQL )
schoolSQL = "SELECT GeographicalAreas.GeographicalAreaDesc,EstablishmentTypes.EstablishmentTypeDesc, Establishments.* FROM GeographicalAreas, Establishments, EstablishmentTypes " _
& " WHERE Establishments.GeographicalAreaID = GeographicalAreas.GeographicalAreaID AND Establishments.EstablishmentTypeID = EstablishmentTypes.EstablishmentTypeID" _
& " ORDER BY GeographicalAreas.GeographicalAreaDesc, EstablishmentTypes.EstablishmentTypeDesc, Establishments.EstablishmentName"
Set RS = Conn.Execute( schoolSQL )
priorGeo = ""
priorET = ""
%>
<%
Do Until rs.EOF
curGeo = RS("GeoGraphicalAreaDesc"
curET = RS("EstablishmentTypeDesc"
If curGeo <> priorGeo Then
If priorGeo <> "<BR>" Then
Response.Write ""
End If
Response.Write "<BR><FONT SIZE=3 FACE=Verdana COLOR=RED>" & "District : " & curGeo & "</FONT>"
priorGeo = curGeo
GeoRS.MoveNext
End IF
If curET <> priorET Then
If priorET <> "<BR>" Then
Response.Write ""
End If
Response.Write "<BR><FONT SIZE=2 FACE=Verdana COLOR=blue>" & "Est Type : " & curET & "</FONT>"
priorET = curET
IF EstTypeRS.BOF or EstTypeRS.EOF = True THEN
Response.Write ""
ELSE
EstTypeRS.MoveNext
End If
End IF
%>
<TABLE BORDER=2 BGCOLOR=#ffffff CELLSPACING=1 CELLPADDING=3><FONT FACE="Arial" COLOR=#000000>
<THEAD>
<TR>
<TH BGCOLOR=#008080 BORDERCOLOR=#000000 nowrap><FONT SIZE=2 FACE="Verdana" COLOR=#ffffff>Establishment Name</FONT></TH>
<TH BGCOLOR=#008080 BORDERCOLOR=#000000 nowrap><FONT SIZE=2 FACE="Verdana" COLOR=#ffffff>Postcode</FONT></TH>
<TH BGCOLOR=#008080 BORDERCOLOR=#000000><FONT SIZE=2 FACE="Verdana" COLOR=#ffffff>Telephone</FONT></TH>
<TH nowrap BGCOLOR=#008080 BORDERCOLOR=#000000><FONT SIZE=2 FACE="Verdana" COLOR=#ffffff>Fax</FONT></TH>
</TR>
</THEAD>
<TBODY>
<TR><TD><FONT SIZE=2 FACE="Verdana" COLOR=#000000><%=RS("EstablishmentName"
%></TD></FONT>
<TD><FONT SIZE=2 FACE="Verdana" COLOR=#000000><%=RS("PostCode"
%></TD></FONT>
<TD><FONT SIZE=2 FACE="Verdana" COLOR=#000000><%=RS("Telephone"
%></TD></FONT>
<TD><FONT SIZE=2 FACE="Verdana" COLOR=#000000><%=RS("Fax"
%></TD></FONT>
</TR>
</TBODY>
<TFOOT></TFOOT>
</TABLE>
<%
rs.MoveNext
Loop
%>
<%
GeoRS.Close
EstTypeRS.Close
RS.Close
Conn.Close
set GeoRS = Nothing
set EstTypeRS = Nothing
set RS = Nothing
set Conn = Nothing
%>
any ideas ?
I am trying to create a report in asp, in order to do this I am using multiple record sets.
I want my data to look like :
Area : UK
County : Powys
name Tel Fax
Bob 123443 123456
james 11111 111112
County : Gwent
name tel fax
steve 123232 123122
jane 121111 232111
and so on, for differnt areas and differnt countys.
problem is, I can't get the format of the :
name tel fax
part to work correctly. so far it looks like
name tel fax
bob 121232 12332
name tel fax
james 111111 111112
how can I only have the Table headings to only appear once per county ?
full code is :
<%
GeoSQL = "SELECT * FROM GeographicalAreas ORDER BY GeographicalAreaDesc"
Set GeoRS = Conn.Execute( GeoSQL )
EstTypeSQL = "SELECT * FROM EstablishmentTypes ORDER BY EstablishmentTypeDesc"
Set EstTypeRS = Conn.Execute( EstTypeSQL )
schoolSQL = "SELECT GeographicalAreas.GeographicalAreaDesc,EstablishmentTypes.EstablishmentTypeDesc, Establishments.* FROM GeographicalAreas, Establishments, EstablishmentTypes " _
& " WHERE Establishments.GeographicalAreaID = GeographicalAreas.GeographicalAreaID AND Establishments.EstablishmentTypeID = EstablishmentTypes.EstablishmentTypeID" _
& " ORDER BY GeographicalAreas.GeographicalAreaDesc, EstablishmentTypes.EstablishmentTypeDesc, Establishments.EstablishmentName"
Set RS = Conn.Execute( schoolSQL )
priorGeo = ""
priorET = ""
%>
<%
Do Until rs.EOF
curGeo = RS("GeoGraphicalAreaDesc"
curET = RS("EstablishmentTypeDesc"
If curGeo <> priorGeo Then
If priorGeo <> "<BR>" Then
Response.Write ""
End If
Response.Write "<BR><FONT SIZE=3 FACE=Verdana COLOR=RED>" & "District : " & curGeo & "</FONT>"
priorGeo = curGeo
GeoRS.MoveNext
End IF
If curET <> priorET Then
If priorET <> "<BR>" Then
Response.Write ""
End If
Response.Write "<BR><FONT SIZE=2 FACE=Verdana COLOR=blue>" & "Est Type : " & curET & "</FONT>"
priorET = curET
IF EstTypeRS.BOF or EstTypeRS.EOF = True THEN
Response.Write ""
ELSE
EstTypeRS.MoveNext
End If
End IF
%>
<TABLE BORDER=2 BGCOLOR=#ffffff CELLSPACING=1 CELLPADDING=3><FONT FACE="Arial" COLOR=#000000>
<THEAD>
<TR>
<TH BGCOLOR=#008080 BORDERCOLOR=#000000 nowrap><FONT SIZE=2 FACE="Verdana" COLOR=#ffffff>Establishment Name</FONT></TH>
<TH BGCOLOR=#008080 BORDERCOLOR=#000000 nowrap><FONT SIZE=2 FACE="Verdana" COLOR=#ffffff>Postcode</FONT></TH>
<TH BGCOLOR=#008080 BORDERCOLOR=#000000><FONT SIZE=2 FACE="Verdana" COLOR=#ffffff>Telephone</FONT></TH>
<TH nowrap BGCOLOR=#008080 BORDERCOLOR=#000000><FONT SIZE=2 FACE="Verdana" COLOR=#ffffff>Fax</FONT></TH>
</TR>
</THEAD>
<TBODY>
<TR><TD><FONT SIZE=2 FACE="Verdana" COLOR=#000000><%=RS("EstablishmentName"
<TD><FONT SIZE=2 FACE="Verdana" COLOR=#000000><%=RS("PostCode"
<TD><FONT SIZE=2 FACE="Verdana" COLOR=#000000><%=RS("Telephone"
<TD><FONT SIZE=2 FACE="Verdana" COLOR=#000000><%=RS("Fax"
</TR>
</TBODY>
<TFOOT></TFOOT>
</TABLE>
<%
rs.MoveNext
Loop
%>
<%
GeoRS.Close
EstTypeRS.Close
RS.Close
Conn.Close
set GeoRS = Nothing
set EstTypeRS = Nothing
set RS = Nothing
set Conn = Nothing
%>
any ideas ?