Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Group Output

Status
Not open for further replies.

TheDoubleB

Programmer
Jan 29, 2001
18
0
0
US
I am grouping my output and when there are more than three detail records in the group the next group heading displays over the top of the previous line. If there are only three group records then it works fine. Anyone ever have this problem?
 
Could you post your code? Just the <cfoutput> part should be enough I would think (unless you think the query is relevant).
 
Here it is:
<CFOUTPUT query=&quot;UData&quot; GROUP=&quot;CODE&quot; >
<TABLE Align=&quot;left&quot; Cellspacing=0 border=&quot;0&quot; WIDTH=&quot;80%&quot; >
<TR>
<TD><FONT Size=&quot;-1&quot; color=&quot;blue&quot;>REG</FONT></TD>
<TD><FONT Size=&quot;-1&quot; color=&quot;blue&quot;>CODE</FONT></TD>
<TD><FONT Size=&quot;-1&quot; color=&quot;blue&quot;>UNIT NAME</FONT></TD>
<TD><FONT Size=&quot;-1&quot; color=&quot;Blue&quot;>DESCRIPTION</font></td>
<TD><FONT Size=&quot;-1&quot; color=&quot;blue&quot;>COUNTY</FONT></TD>
<TD><FONT Size=&quot;-1&quot; color=&quot;blue&quot;>FY</FONT></TD>
</TR>
<TR>
<TD><font size=&quot;-1&quot;>#Region#</font></TD>
<TD><font size=&quot;-1&quot;>#Code#</font></TD>
<TD><font size=&quot;-1&quot;>#UnitName#</font></TD>
<TD><font size=&quot;-1&quot;>#Description#</font></td>
<TD><font size=&quot;-1&quot;>#County#</font></TD>
<TD><font size=&quot;-1&quot;>#UnitFY#</font></TD>
</TR>
</TABLE>
<P>&nbsp;</P>
<P><FONT size=1>#Phone#, #FirstName# #LastName#, #Title#,
#Address#, #City# #State# #zip#</FONT></p>
<TABLE style=&quot;WIDTH: 495px; HEIGHT: 56px&quot; width=495 align=right border=1>
<TR>
<TD><FONT color=blue size=-2>FY</FONT></TD>
<TD><FONT color=blue size=-2>Instrument</FONT></TD>
<TD><FONT color=blue size=-2>FY End</FONT></TD>
<TD><FONT color=blue size=-2>Due Date</FONT></TD>
<TD><FONT color=blue size=-2>Ext</FONT></TD>
<TD><FONT color=blue size=-2>Pending</FONT></TD>
<TD><FONT color=blue size=-2>DelQ</FONT></TD></TR>
<TR>
<CFOUTPUT>
<TD><FONT size=-2>#FY#</FONT></TD>
<TD><FONT size=-2>#Instrument#</FONT></TD>
<TD><FONT size=-2>#DateFormat(FYEnd,'mm/dd/yy')#</FONT></TD>
<TD><FONT size=-2>#DateFormat(DueDate,'mm/dd/yy')#</FONT></TD>
<CFIF #Extension# is (0 or 'No')>
<CFSET #Ext# = 'No'>
<CFELSE>
<CFSET #Ext#='Yes'>
</cfif>
<TD><FONT size=-2>#Ext#</FONT></TD>
<TD><FONT size=-2>#DateFormat(PendingStatus,'mm/dd/yy')#</FONT></TD>
<TD><FONT size=-2>#Delqnum#</FONT></TD></TR>
</cfoutput>
</TABLE></P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
</CFOUTPUT>

I found that if i put in the <P>&nbsp;</P> Then the table will allow up to 4 lines of output before it overwrites. The more of them I add the more lines I see before it overwrites, however it leaves a lot of blank lines for those groups that only have a couple of records.
 
There is a ampersand nbsp in between those <P> </P>'s. I noticed it didn't show them after I posted the code.
 
I'm curious about the <cfoutput> inside the <cfoutput> -- that should be giving you an error. It seems unneccessary so I think you can take that middle <cfoutput> tag pair out. Try that first.

What happens if you remove the width sizing, does it fix the problem? I'm just curious if that's where our problem is, that would narrow it down for you.

Why not use width and height for the table rather than the style attribute? Does that change anything?
 
What is the goal with the layout? You have the paragraph with
Code:
#Phone#, #FirstName# #LastName#, #Title#,
#Address#, #City# #State# #zip#
in it, is that supposed to go between the two tables or do you not care if it goes off to the side? I'm at a high resolution so I see the paragraph off to the side of your first table.

Ultimately one of your concerns is how fast the page will load, so you might want to solve both issues by making one big table rather than two tables for each record. If you wrap a big table around it then it should fix the overlap too. Something like this?
Code:
<TABLE  Align=&quot;left&quot; Cellspacing=0 border=&quot;0&quot; WIDTH=&quot;80%&quot; >
<CFOUTPUT query=&quot;UData&quot; GROUP=&quot;CODE&quot; >
<TR>
    <TD><FONT Size=&quot;-1&quot; color=&quot;blue&quot;>REG</FONT></TD>
    <TD><FONT Size=&quot;-1&quot; color=&quot;blue&quot;>CODE</FONT></TD>
    <TD><FONT Size=&quot;-1&quot; color=&quot;blue&quot;>UNIT NAME</FONT></TD>
    <TD><FONT Size=&quot;-1&quot; color=&quot;Blue&quot;>DESCRIPTION</font></td>
    <TD><FONT Size=&quot;-1&quot; color=&quot;blue&quot;>COUNTY</FONT></TD>
    <TD><FONT Size=&quot;-1&quot; color=&quot;blue&quot;>FY</FONT></TD>
</TR>
<TR>
    <TD><font size=&quot;-1&quot;>#Region#</font></TD>
    <TD><font size=&quot;-1&quot;>#Code#</font></TD>
    <TD><font size=&quot;-1&quot;>#UnitName#</font></TD>
    <TD><font size=&quot;-1&quot;>#Description#</font></td>
    <TD><font size=&quot;-1&quot;>#County#</font></TD>
    <TD><font size=&quot;-1&quot;>#UnitFY#</font></TD>
</TR>
<TR>
	<TD colspan=&quot;6&quot;><FONT size=1>#Phone#, #FirstName# #LastName#, #Title#,
#Address#, #City# #State# #zip#</FONT></TD>
</TR>
	<TD colspan=&quot;6&quot;><TABLE width=495 height=56 align=right border=1>
  <TR>
    <TD><FONT color=blue size=-2>FY</FONT></TD>
    <TD><FONT color=blue size=-2>Instrument</FONT></TD>
    <TD><FONT color=blue size=-2>FY End</FONT></TD>
    <TD><FONT color=blue size=-2>Due Date</FONT></TD>
    <TD><FONT color=blue size=-2>Ext</FONT></TD>
    <TD><FONT color=blue size=-2>Pending</FONT></TD>
    <TD><FONT color=blue size=-2>DelQ</FONT></TD></TR>
  <TR>

    <TD><FONT size=-2>#FY#</FONT></TD>
    <TD><FONT size=-2>#Instrument#</FONT></TD>
    <TD><FONT size=-2>#DateFormat(FYEnd,'mm/dd/yy')#</FONT></TD>
    <TD><FONT size=-2>#DateFormat(DueDate,'mm/dd/yy')#</FONT></TD>
    <CFIF #Extension# is (0 or 'No')>
    <CFSET #Ext# = 'No'>
    <CFELSE>
    <CFSET #Ext#='Yes'>
    </cfif>
    <TD><FONT size=-2>#Ext#</FONT></TD>
    <TD><FONT size=-2>#DateFormat(PendingStatus,'mm/dd/yy')#</FONT></TD>
    <TD><FONT size=-2>#Delqnum#</FONT></TD></TR>

    </TABLE></TD>
</TR>
</CFOUTPUT>
</TABLE>
 
My goal is to duplicate an existing Access Report. The first table has the basic information. The middle paragraph is just a small line with the address, city, state, etc. I'm using the nested <CFOUTPUT> to show the detail for each unit record. Taking out the style didn't help. If you want to send me your e-mail address I'll send you the URL to see what I'm talking about.

billb176@home.com

 
The thing is that you can't nest <cfoutput> tags so I don't know why you're not getting an error. You don't have any attributes in that nested one, so it shouldn't be necessary. If you mean to put a
Code:
query=&quot;something&quot;
in that inner <cfoutput> then you should use <cfloop query=&quot;something&quot;> instead.

How did that example work, did it give you the layout you want?
 
It is a multi-table query. I use nested <CFOUTPUT>'s for the GROUP Function. If I use <CFOUTPUT query=&quot;UData&quot; GROUP=&quot;CODE&quot; >. I get one header record at the &quot;CODE&quot; level and multiple Detail records by nesting the <CFOUTPUT>'s.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top