Last active
January 26, 2017 21:29
-
-
Save neokoenig/e812d357d2fc85824548eb801b979537 to your computer and use it in GitHub Desktop.
Lazy XLS generation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfheader name="Content-Disposition" value="inline; filename=#dateFormat(now(), 'yyyymmdd')#_report.xls"> | |
<cfcontent type="application/vnd.ms-excel"> | |
<html xmlns:o="urn:schemas-microsoft-com:office:office" | |
xmlns:x="urn:schemas-microsoft-com:office:excel" | |
xmlns="http://www.w3.org/TR/REC-html40"> | |
<body> | |
<cfoutput> | |
<table class="table table-condensed"> | |
<thead> | |
<tr> | |
<cfloop list="#data.columnlist#" index="i"> | |
<th>#i#</th> | |
</cfloop> | |
</tr> | |
</thead> | |
<tbody> | |
<cfloop query="data"> | |
<tr> | |
<cfloop list="#data.columnlist#" index="z"> | |
<td>#data["#z#"][currentrow]#</td> | |
</cfloop> | |
</tr> | |
</cfloop> | |
</tbody> | |
</table> | |
</cfoutput> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment