Skip to content

Instantly share code, notes, and snippets.

@dtex
Last active December 18, 2015 10:09
Show Gist options
  • Save dtex/5766397 to your computer and use it in GitHub Desktop.
Save dtex/5766397 to your computer and use it in GitHub Desktop.
Miguel, In this example getInventory() is a function that simply loops through all the rows of a result set and output a <tr> for each one.
<%
if (Request["type"] == "inventorySpreadsheet") {
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("Content-Disposition", "attachment; filename=inventory.xls");%>
<table class="datatable" border="1">
<thead>
<tr>
<th>Description</th>
<th>Lot/Receiver</th>
<th>Qty On Hand</th>
<th>REC#</th>
<th>SO#</th>
<th>PO#</th>
</tr>
</thead>
<tbody>
<% getInventory(); %>
</tbody>
</table><%
}
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment