Hi Everyone,
I have pasted a copy of my code below. All is well with the code and it works just fine, but now one of my end users is asking if I can group the output of data by Division.
I am not sure how to do this with the existing code. I have tried a few different ways but am not getting the results I would like.
Can I do this with the exisitng code, or do I need to rewrite it?
Thanks John
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="2" CLASS="wrapper">
<TR>
<CFIF ParameterExists(Sort) AND Sort IS "DESC">
<CFSET Sort="ASC">
<CFELSE>
<CFSET Sort="DESC">
</CFIF>
<CFOUTPUT>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=division&Sort=#Sort###Tasks"><FONT COLOR="444444">Division</FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=ProjectID&Sort=#Sort###Tasks"><FONT COLOR="444444">RO</FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=TaskID&Sort=#Sort###Tasks"><FONT COLOR="444444">TaskID</FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=Customer&Sort=#Sort###Tasks"><FONT COLOR="444444">Customer</FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=Name&Sort=#Sort###Tasks"><FONT COLOR="444444">Unit</FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=Status&Sort=#Sort###Tasks"><FONT COLOR="444444">Status</FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=Assigned&Sort=#Sort###Tasks"><FONT COLOR="444444">Assigned</FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=JobType&Sort=#Sort###Tasks"><FONT COLOR="444444">Priority</FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=Priority&Sort=#Sort###Tasks"><FONT COLOR="444444">Type</FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=Percentage&Sort=#Sort###Tasks"><FONT COLOR="444444">Progress</FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=Schedule&Sort=#Sort###Tasks"><FONT COLOR="444444">Sch.
Date </FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=DueDate&Sort=#Sort###Tasks"><FONT COLOR="444444">Est. Complete <br />
Date</FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=site&Sort=#Sort###Tasks"><FONT COLOR="444444">Job Site <br />
Location</FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=site&Sort=#Sort###Tasks"><FONT COLOR="444444">Follow Up <br />
Required</FONT></A></FONT></TD>
</CFOUTPUT> </TR>
<TR>
<TD NOWRAP CLASS="DataTD" ID="firstcolumnsolid"><a href="/intranet/projecttracking/projectdetails.cfm?Reason=Modify&ProjectID=#ProjectID#"><font class="DataFont">#division#</font></a></TD>
<TD NOWRAP CLASS="DataTD" ID="firstcolumnsolid"><A HREF="/intranet/projecttracking/projectdetails.cfm?Reason=Modify&ProjectID=#ProjectID#"><FONT CLASS="DataFont">#ProjectID#</FONT></A></TD>
<TD NOWRAP CLASS="DataTD"><A HREF="/intranet/projecttracking/taskdetails.cfm?Reason=Modify&ProjectID=#ProjectID#&TaskID=#TaskID#"><FONT CLASS="DataFont">#TaskID#</FONT></A></TD>
<TD NOWRAP CLASS="DataTD"><A HREF="/intranet/projecttracking/taskdetails.cfm?Reason=Modify&ProjectID=#ProjectID#&TaskID=#TaskID#"><FONT CLASS="DataFont">#Customer#</FONT></A></TD>
<TD NOWRAP CLASS="DataTD"><A HREF="/intranet/projecttracking/taskdetails.cfm?Reason=Modify&ProjectID=#ProjectID#&TaskID=#TaskID#"><FONT CLASS="DataFont">#Unit#<br />#NonEESUnit#</FONT></A></TD>
<TD NOWRAP CLASS="DataTD"><FONT CLASS="DataFont">#Status#</FONT></TD>
<TD NOWRAP CLASS="DataTD" ID="lastcolumnsolid"><FONT CLASS="DataFont">
<CFSET ColorToUse="">
<CFLOOP INDEX="AssignedNumber" FROM="1" TO="#ListLen(Assigned, Comma)#">
<CFIF CompletedUsers CONTAINS "#ListGetAt(Assigned, AssignedNumber, Comma)#">
<CFSET Color="<FONT COLOR='E10000'><B>">
<CFSET ColorEnd="</B></FONT>">
<CFELSEIF ColorToUse IS "Black">
<CFSET Color="">
<CFSET ColorEnd="">
<CFELSE>
<CFSET Color="<FONT COLOR='00A600'><B>">
<CFSET ColorEnd="</B></FONT>">
<CFSET ColorToUse="Black">
</CFIF>
#Color##ListGetAt(Assigned, AssignedNumber, Comma)##ColorEnd#<CFIF AssignedNumber IS NOT "#ListLen(Assigned, Comma)#"><BR></CFIF>
</CFLOOP>
</FONT></TD>
<TD NOWRAP CLASS="DataTD"><FONT CLASS="DataFont">#Priority#</FONT></TD>
<TD NOWRAP CLASS="DataTD"><FONT CLASS="DataFont">#JobType#</FONT></TD>
<TD NOWRAP CLASS="DataTD"><FONT CLASS="DataFont">
<TABLE WIDTH="80" BORDER="0" ALIGN="left" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD ROWSPAN="3" BGCOLOR="000000"><IMG SRC="/intranet/images/spacer.gif" WIDTH="1" HEIGHT="1" BORDER="0"></TD>
<TD COLSPAN="2" BGCOLOR="000000"><IMG SRC="/intranet/images/spacer.gif" WIDTH="1" HEIGHT="1" BORDER="0"></TD>
<TD ROWSPAN="3" BGCOLOR="000000"><IMG SRC="/intranet/images/spacer.gif" WIDTH="1" HEIGHT="1" BORDER="0"></TD>
</TR>
<TR>
<CFIF Percentage IS "0">
<CFSET Color="">
<CFELSE>
<CFSET Color=" BGCOLOR='E10000'">
</CFIF>
<TD WIDTH="#Percentage#%"#Color#><IMG SRC="/intranet/images/spacer.gif" WIDTH="1" HEIGHT="10" BORDER="0"></TD>
<CFIF Percentage IS "100">
<CFSET Color=" BGCOLOR='E10000'">
<CFELSE>
<CFSET Color="">
</CFIF>
<TD WIDTH="#100 - Percentage#%"#Color#><IMG SRC="/intranet/images/spacer.gif" WIDTH="1" HEIGHT="10" BORDER="0"></TD>
</TR>
I have pasted a copy of my code below. All is well with the code and it works just fine, but now one of my end users is asking if I can group the output of data by Division.
I am not sure how to do this with the existing code. I have tried a few different ways but am not getting the results I would like.
Can I do this with the exisitng code, or do I need to rewrite it?
Thanks John
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="1" CELLPADDING="2" CLASS="wrapper">
<TR>
<CFIF ParameterExists(Sort) AND Sort IS "DESC">
<CFSET Sort="ASC">
<CFELSE>
<CFSET Sort="DESC">
</CFIF>
<CFOUTPUT>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=division&Sort=#Sort###Tasks"><FONT COLOR="444444">Division</FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=ProjectID&Sort=#Sort###Tasks"><FONT COLOR="444444">RO</FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=TaskID&Sort=#Sort###Tasks"><FONT COLOR="444444">TaskID</FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=Customer&Sort=#Sort###Tasks"><FONT COLOR="444444">Customer</FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=Name&Sort=#Sort###Tasks"><FONT COLOR="444444">Unit</FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=Status&Sort=#Sort###Tasks"><FONT COLOR="444444">Status</FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=Assigned&Sort=#Sort###Tasks"><FONT COLOR="444444">Assigned</FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=JobType&Sort=#Sort###Tasks"><FONT COLOR="444444">Priority</FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=Priority&Sort=#Sort###Tasks"><FONT COLOR="444444">Type</FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=Percentage&Sort=#Sort###Tasks"><FONT COLOR="444444">Progress</FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=Schedule&Sort=#Sort###Tasks"><FONT COLOR="444444">Sch.
Date </FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=DueDate&Sort=#Sort###Tasks"><FONT COLOR="444444">Est. Complete <br />
Date</FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=site&Sort=#Sort###Tasks"><FONT COLOR="444444">Job Site <br />
Location</FONT></A></FONT></TD>
<TD NOWRAP CLASS="title"><FONT CLASS="ColumnFont"><A HREF="/intranet/projecttracking/taskselecttest.cfm?OrderBy=site&Sort=#Sort###Tasks"><FONT COLOR="444444">Follow Up <br />
Required</FONT></A></FONT></TD>
</CFOUTPUT> </TR>
<TR>
<TD NOWRAP CLASS="DataTD" ID="firstcolumnsolid"><a href="/intranet/projecttracking/projectdetails.cfm?Reason=Modify&ProjectID=#ProjectID#"><font class="DataFont">#division#</font></a></TD>
<TD NOWRAP CLASS="DataTD" ID="firstcolumnsolid"><A HREF="/intranet/projecttracking/projectdetails.cfm?Reason=Modify&ProjectID=#ProjectID#"><FONT CLASS="DataFont">#ProjectID#</FONT></A></TD>
<TD NOWRAP CLASS="DataTD"><A HREF="/intranet/projecttracking/taskdetails.cfm?Reason=Modify&ProjectID=#ProjectID#&TaskID=#TaskID#"><FONT CLASS="DataFont">#TaskID#</FONT></A></TD>
<TD NOWRAP CLASS="DataTD"><A HREF="/intranet/projecttracking/taskdetails.cfm?Reason=Modify&ProjectID=#ProjectID#&TaskID=#TaskID#"><FONT CLASS="DataFont">#Customer#</FONT></A></TD>
<TD NOWRAP CLASS="DataTD"><A HREF="/intranet/projecttracking/taskdetails.cfm?Reason=Modify&ProjectID=#ProjectID#&TaskID=#TaskID#"><FONT CLASS="DataFont">#Unit#<br />#NonEESUnit#</FONT></A></TD>
<TD NOWRAP CLASS="DataTD"><FONT CLASS="DataFont">#Status#</FONT></TD>
<TD NOWRAP CLASS="DataTD" ID="lastcolumnsolid"><FONT CLASS="DataFont">
<CFSET ColorToUse="">
<CFLOOP INDEX="AssignedNumber" FROM="1" TO="#ListLen(Assigned, Comma)#">
<CFIF CompletedUsers CONTAINS "#ListGetAt(Assigned, AssignedNumber, Comma)#">
<CFSET Color="<FONT COLOR='E10000'><B>">
<CFSET ColorEnd="</B></FONT>">
<CFELSEIF ColorToUse IS "Black">
<CFSET Color="">
<CFSET ColorEnd="">
<CFELSE>
<CFSET Color="<FONT COLOR='00A600'><B>">
<CFSET ColorEnd="</B></FONT>">
<CFSET ColorToUse="Black">
</CFIF>
#Color##ListGetAt(Assigned, AssignedNumber, Comma)##ColorEnd#<CFIF AssignedNumber IS NOT "#ListLen(Assigned, Comma)#"><BR></CFIF>
</CFLOOP>
</FONT></TD>
<TD NOWRAP CLASS="DataTD"><FONT CLASS="DataFont">#Priority#</FONT></TD>
<TD NOWRAP CLASS="DataTD"><FONT CLASS="DataFont">#JobType#</FONT></TD>
<TD NOWRAP CLASS="DataTD"><FONT CLASS="DataFont">
<TABLE WIDTH="80" BORDER="0" ALIGN="left" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD ROWSPAN="3" BGCOLOR="000000"><IMG SRC="/intranet/images/spacer.gif" WIDTH="1" HEIGHT="1" BORDER="0"></TD>
<TD COLSPAN="2" BGCOLOR="000000"><IMG SRC="/intranet/images/spacer.gif" WIDTH="1" HEIGHT="1" BORDER="0"></TD>
<TD ROWSPAN="3" BGCOLOR="000000"><IMG SRC="/intranet/images/spacer.gif" WIDTH="1" HEIGHT="1" BORDER="0"></TD>
</TR>
<TR>
<CFIF Percentage IS "0">
<CFSET Color="">
<CFELSE>
<CFSET Color=" BGCOLOR='E10000'">
</CFIF>
<TD WIDTH="#Percentage#%"#Color#><IMG SRC="/intranet/images/spacer.gif" WIDTH="1" HEIGHT="10" BORDER="0"></TD>
<CFIF Percentage IS "100">
<CFSET Color=" BGCOLOR='E10000'">
<CFELSE>
<CFSET Color="">
</CFIF>
<TD WIDTH="#100 - Percentage#%"#Color#><IMG SRC="/intranet/images/spacer.gif" WIDTH="1" HEIGHT="10" BORDER="0"></TD>
</TR>