Using CF8. I'm creating a report using cfdocument what will export as a PDF. I want the report to look like the following:
The loc_code is what determines which grouping the record will be in. Here is the code I'm working with so far without the second heading...not sure where to put it.
What am I doing wrong?
Thanks
Code:
[b]Vendors Within the City[/b]
[i]comm_cd sub-heading[/i]
vendor Name address loc_code
vendor Name address loc_code
[i]comm_cd sub-heading[/i]
vendor Name address loc_code
[i]comm_cd sub-heading[/i]
vendor Name address loc_code
vendor Name address loc_code
vendor Name address loc_code
[b]Vendors Outside the City[/b]
[i]comm_cd sub-heading[/i]
vendor Name address loc_code
vendor Name address loc_code
[i]comm_cd sub-heading[/i]
vendor Name address loc_code
[i]comm_cd sub-heading[/i]
vendor Name address loc_code
vendor Name address loc_code
vendor Name address loc_code
The loc_code is what determines which grouping the record will be in. Here is the code I'm working with so far without the second heading...not sure where to put it.
Code:
My query that is being called from the switch
<cfquery dbtype="query" name="getVendor">
SELECT DISTINCT
comm_cd,
comm_desc,
vend10,
mbe,
gender,
ethnic,
lgl_nm,
street_address,
city,
state,
zip,
loc_code,
phone,
fax
FROM
variables.savedlist
ORDER BY
comm_cd, lgl_nm
</cfquery>
<cfscript>
variables.location = 0;
</cfscript>
<cfif listFind('LO,AU,SL',getvendor.loc_code)>
<cfset variables.location = 1 />
</cfif>
<cfif variables.location EQ 1>
<div style="text-align:left;font-size:10pt;font-weight:bold;font-family:arial;">Vendors Within the City</div>
<cfoutput query="getvendor" group="comm_cd">
<table>
<div style="width: 100%; border: 1px; table-layout:fixed;">
<colgroup>
<col align="left" style="width:400px;"/>
<col align="left" style="width:400px;"/>
<col align="left" style="width:300px;"/>
<col align="left" style="width:300px;"/>
<col align="left" style="width:300px;"/>
<col align="left" style="width:300px;"/>
</colgroup>
<tbody>
<tr>
<td colspan="6"><div style="text-align:left;font-size:8pt;font-weight:bold;font-family:arial;">#getVendor.COMM_CD# #getVendor.comm_desc#</div></td>
</tr>
<cfoutput>
<tr>
<td><div style="text-align:left;font-size:8pt;font-family:arial;"> </div></td>
<td><div style="text-align:left;font-size:8pt;font-family:arial;">#getVendor.VEND10#<br>#getVendor.LGL_NM#<br>#getVendor.street_address#<br>#getVendor.city# #getVendor.state# #getVendor.zip#</div></td>
<td><div style="text-align:left;font-size:8pt;font-family:arial;">#getVendor.phone#<br>#getVendor.fax#</div></td>
<td><div style="text-align:left;font-size:8pt;font-family:arial;">#getVendor.MBE#</div></td>
<td><div style="text-align:left;font-size:8pt;font-family:arial;">#getVendor.GENDER#/#getVendor.ETHNIC#</div></td>
<td><div style="text-align:left;font-size:8pt;font-family:arial;">#getVendor.loc_code#</div></td>
</tr>
</cfoutput>
<tr> </tr>
</tbody>
</div>
</table>
</cfoutput>
</cfif>
What am I doing wrong?
Thanks