This topic is locked

Display 2 lines for each record in list.asp

9/30/2004 4:24:35 PM
ASPRunnerPro General questions
author

I am trying to modify a template so that remarks are put on a second line after all of the other data. Has anyone else done anything similar? To simplify things all of my tables that have a remarks field, all of the fields are called "remarks".

Sergey Kornilov admin 10/3/2004

Dan,
you can try to add the following code snippet at the end of Sub LoopRS in ..._list.asp file (see my changes in bold):

   

iNumberOfRows = iNumberOfRows + 1

   

    Response.write "<tr><td colspan=5>" & rs("Remarks") & "</td></tr>"
    rs.movenext

Loop


Make sure you replace 5 with actual number of columns appear on the list page.

501085 10/5/2004

Thanks Sergey!
That will produce a page with the remarks at the end. However this could also be done editting the finished page. I was hoping to have the template do the work for me.
What I mean is, it would be nice if the template contained a variable that counted the number of columns and inserted it into the "colspan" tag.
Also, since most, but not all of my tables have a remarks field, it would be nice if I could set a flag or check for the existence of the field to determine if the extra row is needed.
Does the template have any kind of variables or conditional statements that can be used?
Thanks again. At least now I know where to look and can get a rough start.
Dan

Sergey Kornilov admin 10/6/2004

Dan,
template language don't have conditional statements however you can use some ASP code to calculate number of columns. rs.Fields.Count variable can tell how many columns are in the recordset. Also you can loop through all recordset fields to see if you have Remarks field.
I hope this helps a little bit.