<link rel="stylesheet" type="text/css" href="../../style/global.css"/>
<!--- use cfsetting to block output of HTML outside of cfoutput tags --->
<CFSETTING enablecfoutputonly="Yes">
<!--- get Pmts info --->
<CFQUERY name="GetPmts" datasource="source">
SELECT *
FROM DuesQ
WHERE yearDue = <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#URL.yearDue#">
AND MebershipType = <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#URL.MebershipType#">
ORDER BY lName ASC
</CFQUERY>
<!--- 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=duesPmts.xls">
<!--- output data using cfloop & cfoutput --->
<!---Column Headings--->
<!---this section will cover the first 3 rows in the spreadsheet--->
<CFOUTPUT><table border="1" bordercolor="##000000"></cfoutput>
<CFOUTPUT>
<tr>
<th colspan="4"><h2>Payments for #GetPmts.MebershipType# Membership for #GetPmts.yearDue#</h2></th>
</tr>
<tr>
<th>Member ID</th>
<th>Name</th>
<th>Pay Date</th>
<th>Amount</th>
</tr>
</CFOUTPUT>
<!---Members payments info--->
<CFLOOP query="GetPmts">
<CFOUTPUT>
<tr bgcolor="###iif(currentrow MOD 2,DE('ffffff'),DE('efefef'))#">
<td>#memberID#</td>
<td>#lName#, #fName#</td>
<td>#Paydate#</td>
<td>#dollarFormat(memdues)#</td>
</tr>
</CFOUTPUT>
</CFLOOP>
<!---Calculate Payment--->
<!---I added the + 3, so it start adding on row four of the spread sheet because the actual data starts on row 4. if you make any changes you must change the number to compensate--->
<CFSCRIPT>
pmtTotal = #GetPmts.recordCount# +3;
</CFSCRIPT>
<!---this will include a total line at the end of the list--->
<CFOUTPUT>
<tr bgcolor="##666666">
<td colspan="3"><font color="##FFFFFF" style="font-weight:bold">TOTAL</font></td>
<td><font color="##FFFFFF" style="font-weight:bold">=SUM(D4:D#pmtTotal#)</font></td>
</tr>
</CFOUTPUT>
<CFOUTPUT></table></CFOUTPUT>