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

Multiple cfoutput groups

Guest
Sep 24, 2008 Sep 24, 2008
I have a report and need the results displayed in multiple groups. From one query result set I am using the cfoutput tag with the query and group attributes to display the results (types and number of workers) by mealtime (Lunch and Dinner). This works fine but I also need the types of workers grouped (with each mealtime) by which part of the restaurant they work in (front, back, management). To do this within the aforementioned cfoutput tag I added another cfoutput tag with a second group option. This almost worked but the problem is that I am only getting the first row of data from each one of the subgroups (where they work) and not all of the rows. I tried adding the query attribute to the nested cfquery attribute but that is not allowed.

Has any one used multiple group attributes in nested cfoutput tags? Can it be done? If so, what am I don't wrong. If not is there another way?

Thanks,

Jason
3.3K
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

correct answers 1 Correct answer

Deleted User
Sep 24, 2008 Sep 24, 2008
CF won't allow you to nest two query driven cfoutput tags. I posted this question to my cfgroup and they were able to answer it.

ANSWER:
At the lowest level, you will want a simple cfoutput without a group on it.

<cfoutput query="qry_my_query" group="outer_grouping_column">

<cfoutput group="inner_grouping_column">

<cfoutput>

</cfoutput>

</cfoutput>

</cfoutput>

Answered by Matt Jones and Brad Wood of the KCDevCore group. Thanks guys!
Translate
LEGEND ,
Sep 24, 2008 Sep 24, 2008
What happened when you tried it?
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
Guest
Sep 24, 2008 Sep 24, 2008
LATEST
CF won't allow you to nest two query driven cfoutput tags. I posted this question to my cfgroup and they were able to answer it.

ANSWER:
At the lowest level, you will want a simple cfoutput without a group on it.

<cfoutput query="qry_my_query" group="outer_grouping_column">

<cfoutput group="inner_grouping_column">

<cfoutput>

</cfoutput>

</cfoutput>

</cfoutput>

Answered by Matt Jones and Brad Wood of the KCDevCore group. Thanks guys!
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 ,
Sep 24, 2008 Sep 24, 2008
jasonpresley wrote:
> Has any one used multiple group attributes in nested cfoutput tags?

Yes, many times.

> Can it be done?

Of course, that is the whole point of the group attribute.

> If so, what am I don't wrong.

I don't know. You did not show what you actually did!

> If not is there another way?

Several, but it does not sound like they are necessary.


If I had to *guess* from your imprecise description, it sounds like you
have forgotten the final inner <cfoutput> block without any group
parameter.

The basic structure is as follows:

<cfoutput query="aQuery" group="aColumn">
Stuff to output once per value of aColumn

<cfoutput group="bColumn">
Stuff to output once per value of bColumn
.
.
.
<cfoutput group="nColumn">
Stuff to output once per value of nColumn

<cfoutput>
Stuff to output for every record in the query
</cfoutput>

Stuff to output oncer per value of nColumn
</cfoutput>
Stuff to output once per value of bColumn
</cfoutput>
Stuff to output once per value of aColumn
</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
Resources