1 Reply Latest reply on Jun 17, 2014 7:51 AM by pete_freitag

    Headers for each change in a Cfoutput

    HumbleCF

      I and trying to do an output that will list the name of a apartment complex and it's corresponding task each time that their apartment number changes

       

      <cfquery name="Running_list" datasource="c124805-h217079">

      SELECT Lisid, LisUnitNo, LisTask,  LisNotes,  LisStatus,  LisPriority, Lisduedate, lissideoftown, proname

      FROM listrun

      LEFT JOIN property ON LisUnitNo = proid

      ORDER BY LisUnitNO, LisPriority desc, Lisduedate

      </cfquery>



      my output code looks like this


      <cfoutput query="running_list">

      #Running_list.proName# - Priority: #Running_list.LisPriority#<br />

      #Running_list.LisStatus#

      #Running_list.LisTask#<br></cfoutput>

       

      My displayed drill-down result to looks like this:

       

      HMC 508 NAS - Priority: 3

      Install Carpet inside of Coat closet


      HMC 508 NAS - Priority: 3

      Install Doorstop behind the kitchen door so that it will not hit the cabinet.

       

      HMC 508 NAS - Priority: 3

      Paint the inside of the rear kitchen door

       

      HMC 508 NAS - Priority: 3

      Check the HVAC closet PVC pipe

       

      HMC 508 NAS - Priority: 3

      Clean Paint from the mini-blind in living room

       

      HMC 508 NAS - Priority: 3

      Touch-up paint closet double door in back bedroom.

      ----------

      AV 102B NAS

      1. ShopVac HVAC Closet

      2. Spray Foam all HVAC Openings and Enclose the line-set inside of PVC.

       



      I want my result to looks like this:


      HISTORIC MANOR COMMUNITY

      Apartment 508 NAS

      1. Install Carpet inside of Coat closet

      2. Install Doorstop behind the kitchen door so that it will not hit the cabinet.

      3. Paint the inside of the rear kitchen door

      4. Check the HVAC closet PVC pipe

      5. Clean Paint from the mini-blind in living room

      6. Touch-up paint closet double door in back bedroom.

       

      ----------

      ALPINE VILLAGE

      Apartment 102-B 

      1. ShopVac HVAC Closet

      2. Spray Foam all HVAC Openings and Enclose the line-set inside of PVC.




      Is it the way that i am doing the cfoutput code?

        • 1. Re: Headers for each change in a Cfoutput
          pete_freitag Adobe Community Professional

          If you want to group by the Apartment name then you can use the group attribute of cfoutput, and specify the column that uniquely identifies the apartment (LisUnitNO perhaps), then you can nest another cfoutput tag inside that to list each record in that group. Make sure the column in the group attribute is also in your SQL order by attribute.

           

          For example:

           

          <cfoutput query="running_list" group="LisUnitNO">

             #running_list.ProName#

             <ol>

                <cfoutput>

                    <li>#rulling_list.LisTask#</li>

                </cfoutput>

             </ol>

          </cfoutput>