ironyx
|
| Posted: 03/31/2003, 10:11 AM |
|
If anyone could give me a hand (no clapping please) I am tryng to change mime types but am confused by all the pages and code CC generates. I would appreciate any direction on this. I saw someinformation on PHP and ASP and assume it will be really close...
Thanks!
Va.
|
|
|
 |
TAiNT
|
| Posted: 04/01/2003, 3:30 AM |
|
Try take a deeper look into doc about CFCONTENT tag or at my quotation.
The following example shows how you might display the results of a query, in an Excel spreadsheet within a ColdFusion page.
<!--- use cfsetting to block output of HTML that is not within cfoutput tags --->
<cfsetting enablecfoutputonly="Yes">
<!--- get Employee info --->
<cfquery name="GetEmps" datasource="CompanyInfo">
SELECT * FROM Employee
</cfquery>
<!--- Set variables for special chars --->
<cfset TabChar = Chr(9)>
<cfset NewLine = Chr(13) & Chr(10)>
<!--- Set content type to invoke Excel --->
<cfcontent type="application/msexcel">
<!--- suggest default name for XLS file --->
<!--- use "Content-Disposition" in cfheader for Internet Explorer --->
<cfheader name="Content-Disposition" value="filename=Employees.xls">
<!--- output data, each row on one line--->
<cfloop query="GetEmps">
<cfoutput>#Emp_ID##TabChar##LastName#
#TabChar##FirstName##TabChar##Salary##NewLine#</cfoutput>
</cfloop>
If you use this tag after the cfflush tag on a page, ColdFusion throws an error.
|
|
|
 |
|