0

From this article i found this code snippet that imports html data to excel:

<%
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "filename=excelfile.xls"
%>
<table>
<tr>
<td>Category Name</td>
<td>Category Description</td>
</tr>
<tr>
<td>Software</td>
<td>Holds data for software</td>
</tr>
<tr>
<td>Hardware</td>
<td>Hardware related data</td>
</tr>
</table>

However, what i want to do is import only one particular table (tableB) in my code below:

<%
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "filename=excelfile.xls"
%>
<table id="tableA" name="tableA">
<tr>
<td>Dont Import</td>
<td>This thing</td>
</tr>
</table>

<table id="tableB" name="tableB">
<tr>
<td>Import</td>
<td>Me</td>
</tr>
</table>

Do you have any suggestions on how i can do this?

Edited by iwanttolearnc: wrong format

3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by jasonsarino
0
<%
     Response.Charset = "ANSI"
     Response.ContentType = "application/octet-stream"
     Response.ContentType = "application/vnd.ms-excel"
     Response.AddHeader "Content-Disposition", "attachment; filename=complete_services.xls" 
     Response.ContentType = "application/download"
%>

<table>
<tr>
    <th>CODe</th>
<tr>
<tr>
    <td>test</td>
</tr>
</table>

Edited by Ezzaral: Snipped blatant site promotion. Read the rules.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.