No ... don't rewrite the report! ... there's ALWAYS a way!
Without seeing the rest of the code its hard to say what would be best. One
idea was already mentioned by Bud I believe. Always have the outer loop,
but just loop once if the service area wasn't selected, then in your inner
loop do the conditional code, i.e., outputting totals, etc. To reference
the information from the service area query use array notation --
query.column[outer loop counter].
Another is to call the inner loop in a cfinclude, then you can have:
<cfif service area not picked>
<cfinclude inner loop>
<cfelse>
<cfloop over service area query>
<cfinclude inner loop>
</cfloop>
</cfif>
HTH,
Dan
-----Original Message-----
From: Angel Stewart [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 29, 2002 11:35 AM
To: CF-Talk
Subject: RE: Looping depending on CFIF Statement
Ok..it's like this.
This is an EXTREMELY simplified version of the page. This is for a
report.
In one instance, I want to loop over several Team Names. One Service
Area could have say..20 Teams.
So the report will show team 1--totals...Team 2--Totals etc. etc.
OR!
The user could just select ONE team, and then display that one Team.
So, the CFIF was to check if the user had selected a Service Area, or
just a Team. If it's a Service Area then display each table with all the
calculations etc. 20 times if necessary using a CFLOOP Query.
Otherwise, just do all that stuff once.
The entire page with all the HTML table formatting, Javascript
calculations etc. is about 300 lines long.
I'd have preferred to just do everything in one report, rather than have
to submit to a Team report , or a Service Area report which is just
using the same damned code, with just two extra lines.
<CFLOOP query="Service Area">
</CFLOOP>
So..thats what I want to do..that was my thinking. And apparently I
can't do it..I might as well just make two separate reports.
-Gel
From: Phoeun Pha
Subject: RE: Looping depending on CFIF Statement
Date: Thu, 29 Aug 2002 08:27:20 -0700
______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists