ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old March 10th, 2005, 03:52 AM
DEfusion DEfusion is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 288 DEfusion User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 26 m 45 sec
Reputation Power: 6
Nested cfoutput with query, group & maxrows problem

Ok, for example say I have the following :

Code:
<cfoutput query="#someQuery#" group="colA" startrow="#startRow#" maxrows="#maxRows#">
     <h3>#colA#</h3>
     <cfoutput>
        other data from the query
     </cfoutput>
</cfoutput>


Now I only want the total number of records that are output to be the value of maxrows. However it appears the maxrows is being applied to the outer cfoutput loop and not the inner, I can't apply a maxrows to the inner loop as you need to combine that attribute with a query.

I'm going to fudge it a little with cfloops instead, but does anyone have any cleaner suggestions?

-D

Reply With Quote
  #2  
Old March 10th, 2005, 08:09 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,618 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 9 h 44 m 33 sec
Reputation Power: 53
I've never had to do this before. You might have to check the queryname.currentRow value within the inner cfoutput and limit the number of records there.

It seems strange to me that you would NOT want the inner cfoutput to always finish its work. If you were outputting 3 makes of cars, and within each make of car you had 10 models, that would be a total of 30 records. If you artificially slapped a 25 record limit on the cfoutput, then you'd lose the last 5 models of the third make. That doesn't make sense to me.

You could also consider limiting the number of records returned by the query itself using the maxRows attribtue of cfquery.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Nested cfoutput with query, group & maxrows problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway