Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How can I output this differently ?

Participant ,
Nov 05, 2009 Nov 05, 2009

I currently output my report in a table using the following :

<table width="760" border="1" bordercolor="black" cellspacing="0" cellpadding="2">
          <tr bgcolor="#DCDEE0">
            <td class="TitleText"  align="center"><b>Month/Year</b></font></td>           
   <td class="TitleText"  align="center"><b>Total Lots In</b></font></td>
   <td class="TitleText"  align="center"><b>Total Lots Out</b></font></td>
          </tr>
          <cfoutput query="qryGetData">
          <tr>
            <td class="TitleText" align="center">#month_status#</td>
   <td class="TitleText" align="center">#totalLotsIn#</td>  
   <td class="TitleText" align="center">#totalLotsout#</td>
          </tr>
    </cfoutput>
</table>

The outout looks something like this :

Month/Year   Total Lots In      Total Lots Out

1/09               10                    20

2/09               30                    30

etc...

How can I change the table to make the output look something like this :

1/09          2/09          3/09

In Out        In Out        In Out

10 20         30 30          40 50

etc..

TOPICS
Getting started
840
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 05, 2009 Nov 05, 2009

Something like this

<cfoutput>

<tr>

<cfloop query = "yourquery">

<td colspan = "2">#month_status#</td>

</cfloop>

</tr>

d

<cfloop query = "yourquery">

<td>in</td><td>out</td>

</cfloop>

</tr>

<tr>

<cfloop query = "yourquery">

<td>#totallotsin#</td>

<td>#totallotsout#</td>

</cfloop>

</tr>

</cfoutput>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 06, 2009 Nov 06, 2009

Dan, your solution works exactly as I requested.

However, the requirements just changed and the output needs to look like this :

Category     11/08    12/08    1/09   2/09.....etc.......Total

Lots In          10          10        30     29.................79

Lots Out     23             10        20     30.................83

I tried to modify your code by taking out the second cfloop but still cannot get it to display in this format.

Can you show me what needs to be done ?

Thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 06, 2009 Nov 06, 2009

I'll do lotsin, you do the other two

<tr>

<td>Lots In></td>

<cfloop query="yourquery">

<td>#lotsin#</td>

</cfloop>

<td>#arraysum(yourquery["lotsin"])#</td>

</tr>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 11, 2009 Nov 11, 2009

That worked great , but how do you get the repeat region to work, Also whats this command for  <td>#arraysum(yourquery["lotsin"])#</td>

I get the record to show right just will not repeat correclty with repeat region... It's all vertical

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 11, 2009 Nov 11, 2009
LATEST

Each column of a cold fusion query object is effectively a 1 dimensional array.  As such, you can use array functions with them.  That specific one gives the person who asked the question the total he was seeking.

I don't know what Repeat Regions are so I can't help you there.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources