Multiple columns w/ grouped output

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Multiple columns w/ grouped output

    I'm familiar with how to dynamically create more than one column in an query,
    but until now, ive never done it in conjunction with a grouped output.

    I'm trying to display article headings, and then beneath those headings their
    articles.
    Here's the code i'm using.

    <cfquery name="GetArticles" datasource="Weddingsetgo">
    select *
    from articletypes,articles
    where articletypes.articletypeid=articles.articletypeid
    order by articletype asc
    </cfquery>
    <CFSET NumberOfColumns = 2>
    <table width=100% valign=top height=100%>
    <tr>
    <cfoutput query="GetArticles" group="Articletype">
    <CFIF (CurrentRow MOD NumberOfColumns) IS 1>
    </TR><TR valign=bottom>
    </CFIF>
    <td>
    <b>#articleheading#</b>
    <cfoutput group="headline">
    <li class="text">#headline#</li>
    </cfoutput>
    </td>
    </cfoutput>
    </tr>
    </table>

    For some odd reason, two columns only appear twice, and then in one row -
    there are three columns.. Anyone have any idea?
    Thanks,

    Explorer5 Guest

  2. Similar Questions and Discussions

    1. STD of multiple columns
      Dear Mysql-ians, I want to calculate the standard deviation of data that are in multiple columns. I know how to calculate the STD of 1 column...
    2. Left join, grouped output question
      Hey All, I have a SQL JOIN / Output question. So for this simple CMS I have built I two tables I am joinging. An "issues" table (as in magazine...
    3. Datagrid in multiple columns
      It is possible to arrange the datagrid it self into multiple columns? For example I have a grid with two items - id and name. I have over 600...
    4. Generating table rows and columns in output?
      When I output the query results, I would like to display them in a 4 column table. While I can have it add a column as cell as in...
    5. help w/ multiple columns in NSTableView
      Hey All, I'm trying to load a file with columns of data separated by white space and display it in an NSTableView. The file loads fine, but each...
  3. #2

    Default Re: Multiple columns w/ grouped output

    try adding the 'group by' to the query itself, in the sql. my hunch is the recordset pointer for the CurrentRow variable gets thrown out of whack by the 'group by' parameter in the query output.
    JJBBDD 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