gatsrulz
MIS
- Sep 2, 2004
- 60
Nothing gets written into the excel file. Not even the titles. Please assist
My code is as follows
<html>
<head>
<title>Forum Admin</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<cfquery name=MQuery >
select * from Forummembers where Fid = #url.id# and datediff(day, dateofexpiry, getdate()) < -7
</cfquery>
<cfif MQuery.recordcount GT 66000>
Too many records
<cfelse>
<cfset parlist = "">
<cfset titlist = "">
<cfset titlist = listappend(titlist, "Name" & " ")>
<cfset titlist = listappend(titlist, "Address" & " ")>
<cfset titlist = listappend(titlist, "City" & " ")>
<cfset titlist = listappend(titlist, "State" & " ")>
<cfset titlist = listappend(titlist, "Zip" & " ")>
<cfset titlist = listappend(titlist, "E-Mail" & " ")>
<cfset parlist = listappend(parlist, titlist, "")>
<cfoutput query="MQuery">
<cfset kidlist = "">
<cfset kidlist = listappend(kidlist, trim(name) & "")>
<cfset kidlist = listappend(kidlist, trim(address) & "")>
<cfset kidlist = listappend(kidlist, trim(city) & "")>
<cfset kidlist = listappend(kidlist, trim(state) & "")>
<cfset kidlist = listappend(kidlist, trim(zip) & "")>
<cfset kidlist = listappend(kidlist, trim(email) & "")>
<cfset parlist = listappend(parlist, kidlist, "")>
</cfoutput>
<cffile action="write" file="#expandpath('.')#\Lapse.csv" output="#parlist#" addnewline="no">
<div align="center">
<p><font face="verdana, sans-
serif" size="2"> <strong>Lapsed Member list generated...<br>
<a href="Laspe.csv" target="_blank">Click here to complete the download</a> </strong></font></p>
</div>
</cfif>
</body>
</html>
My code is as follows
<html>
<head>
<title>Forum Admin</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<cfquery name=MQuery >
select * from Forummembers where Fid = #url.id# and datediff(day, dateofexpiry, getdate()) < -7
</cfquery>
<cfif MQuery.recordcount GT 66000>
Too many records
<cfelse>
<cfset parlist = "">
<cfset titlist = "">
<cfset titlist = listappend(titlist, "Name" & " ")>
<cfset titlist = listappend(titlist, "Address" & " ")>
<cfset titlist = listappend(titlist, "City" & " ")>
<cfset titlist = listappend(titlist, "State" & " ")>
<cfset titlist = listappend(titlist, "Zip" & " ")>
<cfset titlist = listappend(titlist, "E-Mail" & " ")>
<cfset parlist = listappend(parlist, titlist, "")>
<cfoutput query="MQuery">
<cfset kidlist = "">
<cfset kidlist = listappend(kidlist, trim(name) & "")>
<cfset kidlist = listappend(kidlist, trim(address) & "")>
<cfset kidlist = listappend(kidlist, trim(city) & "")>
<cfset kidlist = listappend(kidlist, trim(state) & "")>
<cfset kidlist = listappend(kidlist, trim(zip) & "")>
<cfset kidlist = listappend(kidlist, trim(email) & "")>
<cfset parlist = listappend(parlist, kidlist, "")>
</cfoutput>
<cffile action="write" file="#expandpath('.')#\Lapse.csv" output="#parlist#" addnewline="no">
<div align="center">
<p><font face="verdana, sans-
serif" size="2"> <strong>Lapsed Member list generated...<br>
<a href="Laspe.csv" target="_blank">Click here to complete the download</a> </strong></font></p>
</div>
</cfif>
</body>
</html>