freelanceprogrammers.org Forum Index » Cold Fusion

Suppressing repeating names on cfoutput


View user's profile Post To page top
daniel.k.kang@... Posted: Sun May 01, 2005 5:44 am


Joined: 26 Mar 2005

Posts: 5
Suppressing repeating names on cfoutput
<cfoutput query="GetForm">
<tr>
<td bgcolor="CCCCFF">#UnitName#</td>
bla …

This cfoutput prints the locations:

2 North
2 South
2 South
2 South
2 West 1
2 West 1
3 West 1
CCU 10
Dialysis
Dialysis
…..

I want to suppress the repeating locations so that it prints:

2 North
2 South
-
-
2 West 1
-
3 West 1
CCU 10
Dialysis
-
…..

Please advise.

tia
Reply with quote
Send private message
View user's profile Post To page top
daniel.k.kang@... Posted: Sun May 01, 2005 7:47 am


Joined: 26 Mar 2005

Posts: 5
Suppressing repeating names on cfoutput
For clarification --

I have tried these:

<cfoutput
query = "query_name"
group = "query_column"
groupCaseSensitive = "Yes" or "No"
startRow = "start_row"
maxRows = "max_rows_output">
</cfoutput>

<cfoutput query="myQuery" group="query_column1">
# query_column1#<br>
<cfoutput group=" query_column2">
# query_column2#<br>
<cfoutput>
# query_column3#<br>
</cfoutput>
</cfoutput>
</cfoutput>

but these do not work for this specific case since there are many more
columns.

so, what I am looking for is suppressing only the first column by
perhaps using cfif.

<cfif query_column1 exists previous colums>
suppress
<else>
query_column1
</cfif>

???

tia

On 4/30/05, Daniel Kang <daniel.k.kang@...> wrote:
> <cfoutput query="GetForm">
> <tr>
> <td bgcolor="CCCCFF">#UnitName#</td>
> bla …
>
> This cfoutput prints the locations:
>
> 2 North
> 2 South
> 2 South
> 2 South
> 2 West 1
> 2 West 1
> 3 West 1
> CCU 10
> Dialysis
> Dialysis
> …..
>
> I want to suppress the repeating locations so that it prints:
>
> 2 North
> 2 South
> -
> -
> 2 West 1
> -
> 3 West 1
> CCU 10
> Dialysis
> -
> …..
>
> Please advise.
>
> tia
>
Reply with quote
Send private message
View user's profile Post To page top
sandersfred Posted: Mon May 02, 2005 11:06 am


Joined: 02 May 2005

Posts: 11
Suppressing repeating names on cfoutput
Why not change your select statement in the query to select distinct?

If that doesn`t work keep a temp variable (a list is fine) that your dumping
the value into, and cfif NOT listfind() {add to list, and cfoutput value}.

If I wasn`t so rusty and if I actually had cf server running, I`d even mock up
real code, but sinse I don`t, I`ll let you write it, however depending on
your db, either one or the other should be a valid option for you.

Fred T. Sanders


On Saturday 30 April 2005 22:47, Daniel Kang wrote:
> For clarification --
>
> I have tried these:
>
> <cfoutput
> query = "query_name"
> group = "query_column"
> groupCaseSensitive = "Yes" or "No"
> startRow = "start_row"
> maxRows = "max_rows_output">
> </cfoutput>
>
> <cfoutput query="myQuery" group="query_column1">
> # query_column1#<br>
> <cfoutput group=" query_column2">
> # query_column2#<br>
> <cfoutput>
> # query_column3#<br>
> </cfoutput>
> </cfoutput>
> </cfoutput>
>
> but these do not work for this specific case since there are many more
> columns.
>
> so, what I am looking for is suppressing only the first column by
> perhaps using cfif.
>
> <cfif query_column1 exists previous colums>
> suppress
> <else>
> query_column1
> </cfif>
>
> ???
>
> tia
>
> On 4/30/05, Daniel Kang <daniel.k.kang@...> wrote:
> > <cfoutput query="GetForm">
> > <tr>
> > <td bgcolor="CCCCFF">#UnitName#</td>
> > bla …
> >
> > This cfoutput prints the locations:
> >
> > 2 North
> > 2 South
> > 2 South
> > 2 South
> > 2 West 1
> > 2 West 1
> > 3 West 1
> > CCU 10
> > Dialysis
> > Dialysis
> > …..
> >
> > I want to suppress the repeating locations so that it prints:
> >
> > 2 North
> > 2 South
> > -
> > -
> > 2 West 1
> > -
> > 3 West 1
> > CCU 10
> > Dialysis
> > -
> > …..
> >
> > Please advise.
> >
> > tia
>
> Yahoo! Groups Links
>
>
>
Reply with quote
Send private message
View user's profile Post To page top
daniel.k.kang@... Posted: Mon May 02, 2005 5:30 pm


Joined: 26 Mar 2005

Posts: 5
Suppressing repeating names on cfoutput
Distinct does work for this case.
Instead, I found that the below works for me:

<cfOutput group="UnitName" query="queryName">
<tr>
<td>#unitName#</td>
<cfSet count = 1>
<cfOutput>
<cfIf count NEQ 1>
</tr>
<tr>
<td>&nbsp;</td>
</cfIf>
<td>
#formID#
</td>
<td>
#description#
</td>
.....
</tr>
<cfSet count = count + 1>

Daniel

On 5/2/05, Fred T. Sanders <fred@...> wrote:
> Why not change your select statement in the query to select distinct?
>
> If that doesn`t work keep a temp variable (a list is fine) that your dumping
> the value into, and cfif NOT listfind() {add to list, and cfoutput value}.
>
> If I wasn`t so rusty and if I actually had cf server running, I`d even mock up
> real code, but sinse I don`t, I`ll let you write it, however depending on
> your db, either one or the other should be a valid option for you.
>
> Fred T. Sanders
>
>
> On Saturday 30 April 2005 22:47, Daniel Kang wrote:
> > For clarification --
> >
> > I have tried these:
> >
> > <cfoutput
> > query = "query_name"
> > group = "query_column"
> > groupCaseSensitive = "Yes" or "No"
> > startRow = "start_row"
> > maxRows = "max_rows_output">
> > </cfoutput>
> >
> > <cfoutput query="myQuery" group="query_column1">
> > # query_column1#<br>
> > <cfoutput group=" query_column2">
> > # query_column2#<br>
> > <cfoutput>
> > # query_column3#<br>
> > </cfoutput>
> > </cfoutput>
> > </cfoutput>
> >
> > but these do not work for this specific case since there are many more
> > columns.
> >
> > so, what I am looking for is suppressing only the first column by
> > perhaps using cfif.
> >
> > <cfif query_column1 exists previous colums>
> > suppress
> > <else>
> > query_column1
> > </cfif>
> >
> > ???
> >
> > tia
> >
> > On 4/30/05, Daniel Kang <daniel.k.kang@...> wrote:
> > > <cfoutput query="GetForm">
> > > <tr>
> > > <td bgcolor="CCCCFF">#UnitName#</td>
> > > bla …
> > >
> > > This cfoutput prints the locations:
> > >
> > > 2 North
> > > 2 South
> > > 2 South
> > > 2 South
> > > 2 West 1
> > > 2 West 1
> > > 3 West 1
> > > CCU 10
> > > Dialysis
> > > Dialysis
> > > …..
> > >
> > > I want to suppress the repeating locations so that it prints:
> > >
> > > 2 North
> > > 2 South
> > > -
> > > -
> > > 2 West 1
> > > -
> > > 3 West 1
> > > CCU 10
> > > Dialysis
> > > -
> > > …..
> > >
> > > Please advise.
> > >
> > > tia
> >
> > Yahoo! Groups Links
> >
> >
> >
>
> Yahoo! Groups Links
>
>
>
>
>
Reply with quote
Send private message
Post new topic Reply to topic
Display posts from previous:   
 

All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help