HI I need help. I have a field which is a text field in access even though
it hold numbers. However, I have a cfcontent tag and when I open the excel
file, it takes away all zeros from the front. How can I keep all the digits
there and let excel know that it is text. Also, the only way I've found to
separate my fields is by putting a tab and another character afterward. If
I put a plain tab excel joins the fields. Please help.
Thanks
-----Original Message-----
From: Miriam Hirschman [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 28, 2001 11:09 AM
To: CF-Talk
Subject: RE: CFCONTENT in CF4 and CF4.5
Why does it look fine on my hard drive?? And not when it is running off the
CF 4.5 Server. Thnaks for your help.
Here is my code:
CFSETTING enablecfoutputonly="Yes">
<html><body bgcolor="White">
<cfquery name="qryGetSummary" datasource="csesdr" dbtype="ODBC">
#Form.txtSql#
#preserveSingleQuotes(Form.txtDate)#
ORDER BY Niin
</cfquery>
<cfheader name="content-disposition" value="filename=Summary.xls">
<cfcontent type="application/msexcel">
<cfloop query="qryGetSummary">
<cfset strComment=#ReReplace("#cOMMENT#","[[:cntrl:]]"," ","ALL")#>
<cfset strGood=#ReReplace("#niin#","[[:cntrl:]]"," ","ALL")#>
<cfoutput>#strGood# #Activity# #DateFormat('#MaxOfmyDate#','mm/dd/yyy')#
#strComment# #EquipmentValue# #DeficitQuantity#
</cfoutput>
</cfloop>
</body></html><CFSETTING enablecfoutputonly="no">
-----Original Message-----
From: Dave Watts [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 28, 2001 10:59 AM
To: '[EMAIL PROTECTED]'
Cc: '[EMAIL PROTECTED]'
Subject: RE: CFCONTENT in CF4 and CF4.5
> Can someone please tell me the change in the way the
> CFCONTENT tag works in CF4 and CF 4.5. Meaning, in CF 4.0
> the excel file that I am creating looks fine. The each
> field is in a separate cell. However, when running off
> a 4.5 server all the fields are attached and are displayed
> in one cell.
The CFCONTENT tag doesn't have anything to do with this (and hasn't changed
between 4.0.x and 4.5.x). When used with dynamic content generation, as
opposed to returning an existing file from the filesystem, all CFCONTENT
does is creates an HTTP header which describes the MIME type of the content.
My guess is that you've got a carriage return missing on the page that's
causing the problem. When generating CSV, for example, this:
<cfoutput query="myquery">#field1#,#field2#,#field3#</cfoutput>
will generate one line, while this:
<cfoutput query="myquery">#field1#,#field2#,#field3#
</cfoutput> (note the closing CFOUTPUT on a second line)
will generate the multiple lines you want.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists