ColdFusion 7 output to Excel Spreadsheet
I am working in ColdFusion MX7 (sorry). I am outputting database data into a spreadsheet and have run into issues with outputting integers correctly.
In one of the Excel cells I have to interpolate text (counties) and output number codes for each like this (the database field being queried is "County"):
<cfcontent type="application/msexcel">
<cfoutput query="GetSelect" group="number">
<cfif County eq 'Franklin'><cfset CC = '049'>
<cfelseif County eq 'Delaware'><cfset CC= '041' >
<cfelseif County eq 'Union'><cfset CC='159'>
<cfelseif County eq 'Muskingum'><cfset CC='119'>
<cfelse><cfset CC= #County#></cfif>
#CC##tabchar#
</cfoutput>
The problem that Excel output the numbers like 159 or 119 correctly, but if the code number begins with a 0, it drops the zero and outputs 49 or 41 instead of 049 or 041.
Any suggestions on how to achieve this?
-Eric Davis
