how to display data in 3 columns by 4 rows format

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default how to display data in 3 columns by 4 rows format

    All,

    I will be eternally greatful if someone can provide snippet of code,
    URL or reference material that shows how to display data in a "n
    colums * n rows" format.

    I am new to ASP and have looked everywhere that I could, but I have
    not found an example where data can be formatted to be displayed in a
    3 * 4 foramt, like many of the professional sites would do (actually
    rows and columns can be any number of rows and columns) All the
    examples that I have seen, show data displayed in a top down format.

    Best Regards,

    Addi
    addi Guest

  2. Similar Questions and Discussions

    1. Howto display an ASP.net datagrid rows as columns and vice versa?
      Hi I want to display my datagrid with the columns horizontal and rows vertical, so just the other way around. For example instead of : name ...
    2. trying to create data grid on the fly, with templated columns, and then updating all rows in the grid
      Hi, Please help, I'm trying to create data grid on the fly, with templated columns, for editing, and then updating all rows in the grid on one...
    3. Data format and display
      Hello list, I have a table that contains this raw data: epr_procode | epr_tipo | epr_mes | epr_valor | zert_title...
    4. Display 1 data row as multiple datagrid rows
      If a row of data in a dataset has a lot of columns the row displaying the data in a datagrid will run way off the screen. What I'd like to do is...
    5. Pad strings/concatenate columns to simulate data columns in ASP select box with SQL Server 2K
      Dale, Cast all the data to fixed character data type in your select statement. For example: select cast(au_id as char(12)) +...
  3. #2

    Default Re: how to display data in 3 columns by 4 rows format

    [url]http://www.aspfaq.com/show.asp?id=2247[/url]





    "addi" <addi_s@hotmail.com> wrote in message
    news:6f426fb3.0312292021.9425d13@posting.google.co m...
    > All,
    >
    > I will be eternally greatful if someone can provide snippet of code,
    > URL or reference material that shows how to display data in a "n
    > colums * n rows" format.
    >
    > I am new to ASP and have looked everywhere that I could, but I have
    > not found an example where data can be formatted to be displayed in a
    > 3 * 4 foramt, like many of the professional sites would do (actually
    > rows and columns can be any number of rows and columns) All the
    > examples that I have seen, show data displayed in a top down format.
    >
    > Best Regards,
    >
    > Addi

    Foo Man Chew Guest

  4. #3

    Default help: loop within a loop - Re: how to display data in 3 columns by 4 rows format

    All,

    Well I got the data to display the way I wanted using the example provided
    in the following links. Now I am stuck with another dilema. I am trying to
    implement paging within my example and it does not seem to page thru. I have
    used two independent examples (1 for paging, the other for displaying data)
    and they both seem to work fine. When I combine them, it only processes the
    first 9 records and paging does not seem to work. Any input on where the
    code is broken would be greatly appreciated. The following is a working
    example, using the pubs database in SQL Server.


    <%
    set conn = Server.CreateObject("ADODB.Connection")
    conn.Open "DSN=wbsql", "sa", "golf"

    set rs = Server.CreateObject("ADODB.Recordset")
    rs.CursorLocation = 3 ' adUseClient
    rs.Open "Select * from pubs..authors", conn
    intPageCount = rs.PageCount
    rs.PageSize = 9

    Select Case Request("Action")
    case "<<"
    intpage = 1
    case "<"
    intpage = Request("intpage")-1
    if intpage < 1 then intpage = 1
    case ">"
    intpage = Request("intpage")+1
    if intpage > intPageCount then intpage = IntPageCount
    Case ">>"
    intpage = intPageCount
    case else
    intpage = 1
    end select
    %>
    <table border="2" align=center>
    <%
    numCols = 3
    intPage = rs.AbsolutePage
    rsPageSize = rs.PageSize
    i = 0

    Do while i < rsPageSize
    needFooter = true

    if i mod numCols = 0 then
    response.write "<tr>"
    end if

    response.write "<td align=center>"
    response.Write "<P>" & rs(0) & "</P>"
    response.Write "<P>" & rs(1) & "</P>"
    response.Write "<P>" & rs(2) & "</P>"

    response.write "</td>"

    if i mod numCols = numCols - 1 then
    response.write "</tr>"
    needFooter = false
    end if
    i = i + 1
    rs.MoveNext
    Loop

    if needFooter then
    response.write "<td colspan=" &_
    numCols - (i mod numCols) &_
    "> </td></tr>"
    end if
    response.write "</table>"

    rs.Close
    set rs = Nothing
    conn.Close
    set conn = nothing
    %>
    </table>
    <%

    %>
    <form name="MovePage" action="test1.asp" method="post" ID="Form1">
    <input type="hidden" name="intpage" value="<%=intpage%>" ID="Hidden1">
    <input type="submit" name="action" value="<<" ID="Submit1">
    <input type="submit" name="action" value="<" ID="Submit2">
    <input type="submit" name="action" value=">" ID="Submit3">
    <input type="submit" name="action" value=">>" ID="Submit4">
    Page: <%=Intpage & " of " & intpagecount%>
    </form>
    </BODY>
    </HTML>


    Best Regards,

    Addi




    "Foo Man Chew" <foo@man.chew> wrote in message
    news:uN36T9pzDHA.2452@tk2msftngp13.phx.gbl...
    > [url]http://www.aspfaq.com/show.asp?id=2247[/url]
    >
    >
    >
    >
    >
    > "addi" <addi_s@hotmail.com> wrote in message
    > news:6f426fb3.0312292021.9425d13@posting.google.co m...
    > > All,
    > >
    > > I will be eternally greatful if someone can provide snippet of code,
    > > URL or reference material that shows how to display data in a "n
    > > colums * n rows" format.
    > >
    > > I am new to ASP and have looked everywhere that I could, but I have
    > > not found an example where data can be formatted to be displayed in a
    > > 3 * 4 foramt, like many of the professional sites would do (actually
    > > rows and columns can be any number of rows and columns) All the
    > > examples that I have seen, show data displayed in a top down format.
    > >
    > > Best Regards,
    > >
    > > Addi
    >
    >

    addi Guest

  5. #4

    Default How to display data in 3 columns by 4 rows format

    All,
    This is a good example but i seem that number of records not flexibility, it's supposed to be following the number of data in recordset (rs.PageSize = 12) means i've 12 of data of record and will be display all, when i put rs.Pagesize =10, it does show only 10 record, please help me.

    Thanks,

    asp newbie
    Unregistered Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139