Link to home
Start Free TrialLog in
Avatar of onaled777
onaled777Flag for United States of America

asked on

Opening an excel file in ColdFusion 8

With the code below I am attempting to open an excel file when the submit button of a form is pressed by I keep getting a page with the following on the first line:

'); } } function writeCloseBody() { if( debugMode ) { document.write('

Can someone show me how to correct this?


<cfsetting enablecfoutputonly="Yes">
 
 
<cfparam name="publisher">	
<cfparam name="productcode">		
<cfparam name="campaign">
<cfparam name="cpa">
<cfparam name="exiturl">
<cfparam name="MOJOCreativeID">
<cfparam name="MOJOPlacementID">
<cfparam name="PageID">
<cfparam name="PageWght">
<cfparam name="CampaignCount">
 
 
<cfif isDefined("Form")>
	<cfset publisher = Form.publisher>
	<cfset product_code = Form.productcode>
	<cfset campaign_name = Form.campaign>
	<cfset cpa = Form.cpa>
	<cfset exit_url = Form.exiturl>
</cfif>
 
 
 
<cfcontent type="application/msexcel">
 
<cfheader name="Content-Disposition" value="filename=BulkCampExcel.xls">
 
	<cfoutput>
		<table cols="2">
			<tr>
				<th>publisher</th>	
				<th>product_code</th>		
				<th>campaign_name</th>
				<th>cpa</th>
				<th>exit_url</th>
				<th>MOJOCreativeID</th>
				<th>MOJOPlacementID</th>
				<th>PageID</th>
				<th>PageWght</th>
			</tr>
		<cfloop index = "LoopCount" from = "1" to = "#CampaignCount#">
			<tr>
				<td>#publisher#</td>	
				<td>#productcode#</td>		
				<td>#campaign#</td>
				<td>#cpa#</td>
				<td>#exiturl#</td>
				<td>#MOJOCreativeID#</td>
				<td>#MOJOPlacementID#</td>
				<td>#PageID#</td>
				<td>#PageWght#</td>
			</tr>
		</cfloop>
	</table>
</cfoutput>

Open in new window

Avatar of Pravin Asar
Pravin Asar
Flag of United States of America image

ASKER CERTIFIED SOLUTION
Avatar of Pravin Asar
Pravin Asar
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial