I'm trying to export a report in Excel using Coldfusion, however all the data displays in just 1 cell. How do I make the report display the way it want it to.
Here is my code for the excel report
<cfswitch expression="#form.report#"
>
<cfcase value="1">
<!--- feature --->
<cfinclude template="qry_feature.cfm"
>
<cfset strReport = 'Feature Report'>
</cfcase>
<cfcase value="2">
<!--- feature same day add/delete --->
<cfinclude template="qry_featuresamed
ayadddelet
e.cfm">
<cfset strReport = 'Features Same Day ADD/DEL Report'>
</cfcase>
<cfcase value="3">
<!--- feature same day add/delete --->
<cfinclude template="qry_servicesamed
ayadddelet
e.cfm">
<cfset strReport = 'Services Same Day ADD/DEL Report'>
</cfcase>
<cfcase value="4">
<!--- feature same day add/delete --->
<cfinclude template="qry_servicedupes
.cfm">
<cfset strReport = 'Service Duplicates Report'>
</cfcase>
<cfcase value="5">
<!--- feature same day add/delete --->
<cfinclude template="qry_prepaydupe.c
fm">
<cfset strReport = 'Prepay Duplicates Report'>
</cfcase>
<cfcase value="6">
<!--- feature same day add/delete --->
<cfinclude template="qry_contractdupe
s.cfm">
<cfset strReport = 'Contract Duplicates Report'>
</cfcase>
<cfcase value="7">
<!--- feature same day add/delete --->
<cfinclude template="qry_featuredupe.
cfm">
<cfset strReport = 'Feature Duplicate Report'>
</cfcase>
<cfdefaultcase>
<p>error!</p>
</cfdefaultcase>
</cfswitch>
<cfset strReport = strReport & ' Current Cycledates: ' & form.cycledates &' '>
<cfset strReport = strReport & 'Current Markets: '>
<cfif form.which_markets NEQ ''>
<cfset strReport = strReport & form.which_markets & ' '>
<cfelse>
<cfset strReport = strReport & 'All Markets '>
</cfif>
<cfset strReport = strReport & 'Current Channels: '>
<cfif form.which_channels NEQ ''>
<cfset strReport = strReport & form.which_channels & ' '>
<cfelse>
<cfset strReport = strReport & 'All Channels '>
</cfif>
<cfsavecontent variable="outitgoes"><cfou
tput>#strR
eport##chr
(13)#</cfo
utput>
<cfoutput>#Replace('#getma
in.columnl
ist#',',',
chr(0009),
'ALL')##chr(13)#</cfoutput
>
<cfoutput query="getmain">
<cfloop index="i" list="#getmain.columnlist#
">
#evaluate(i)##chr(0009)#
</cfloop>
</cfoutput>
</cfsavecontent>
<CFHEADER NAME="Content-Disposition"
VALUE="Inline;filename=fil
tereddata#
CreateUUID
()#.xls">
<cfcontent type="application/vnd.ms-e
xcel" >
<cfoutput>#outitgoes#</cfo
utput>
I want it similiar to whats displayed on the screen when a user runs the report. Here is an example of that code
<table class="reportTable">
<tr>
<th class="reportHeader">Marke
t</th>
<th class="reportHeader">Chann
el</th>
<th class="reportHeader">Empli
d</th>
<th class="reportHeader">Accou
ntnbr</th>
<th class="reportHeader">Phone
nbr</th>
<th class="reportHeader">Ratep
lan</th>
<th class="reportHeader">Recor
dtype</th>
<th class="reportHeader">Servi
cetype</th
>
<th class="reportHeader">Produ
ct</th>
<th class="reportHeader">Count
(inputseq)
</th>
</tr>
<cfoutput query="getmain" >
<tr>
<td class="reportCell">#getmai
n.Market#<
/td>
<td class="reportCell">#getmai
n.Channel#
</td>
<td class="reportCell">#getmai
n.Emplid#<
/td>
<td class="reportCell">#getmai
n.Accountn
br#</td>
<td class="reportCell">#getmai
n.Phonenbr
#</td>
<td class="reportCell">#getmai
n.rateplan
#</td>
<td class="reportCell">#getmai
n.Recordty
pe#</td>
<td class="reportCell">#getmai
n.Servicet
ype#</td>
<td class="reportCell">#getmai
n.Product#
</td>
<td class="reportCell">#getmai
n.Countinp
utseq#</td
>
</tr>
</cfoutput>
</table>
Start Free Trial