mudface061200
asked on
ASP to Excel
I have an HTML table that I want the user to be able to save to Excel. What is the best way to do this? Thanks.
-m
-m
Read this; http://support.microsoft.com/default.aspx?scid=kb;EN-US;q195951
ASKER
The link you have provided is the opposite of what I need. I have a table in HTML that I want to save to Excel. The link you gave me is reading an Excel file into HTML..
Thanks anyway.
-m
Thanks anyway.
-m
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
just change the content type to application/vnd-excel before outputting the table.
example:
<%response.contenttype="ap plication/ vnd-excel" %>
<table>
<tr>
<td>15</td>
<td>20</td>
<td>=$A1+$A2</td>
</tr>
</table>
example:
<%response.contenttype="ap
<table>
<tr>
<td>15</td>
<td>20</td>
<td>=$A1+$A2</td>
</tr>
</table>
dredge,
that's the same solution i posted.
BRUNO
that's the same solution i posted.
BRUNO
ASKER
So I can't have any <% %> tags after I say response.contenttype="appl ication/vn d-excel"?
ASKER
I guess I am not convinced just yet. =)
I understand that response.contenttype="appl ication/vn d-excel"
makes the entire page an excel file, but I only want the table. The table is created in a function. So basically I need to, when the user clicks on "Export to Excel" for example, say response.contenttype="appl ication/vn d-excel" then recall the table creating function. Could you provide a couple lines of code? Thanks.
-m
I understand that response.contenttype="appl
makes the entire page an excel file, but I only want the table. The table is created in a function. So basically I need to, when the user clicks on "Export to Excel" for example, say response.contenttype="appl
-m
mudface,
be convinced, it's the best way to do it. you can use asp tags after that, you can dynamically choose your data to export if you want. there is more info here (last question in the bottom right frame) :
http://msdn.microsoft.com/library/default.asp?URL=/library/en-us/dn_voices_webmen/html/webteam07032000.asp
Good luck and let me know if more help is needed.
BRUNO
be convinced, it's the best way to do it. you can use asp tags after that, you can dynamically choose your data to export if you want. there is more info here (last question in the bottom right frame) :
http://msdn.microsoft.com/library/default.asp?URL=/library/en-us/dn_voices_webmen/html/webteam07032000.asp
Good luck and let me know if more help is needed.
BRUNO
If you really don't believe me, check my profile I've answered this same question 3 times before with good results. :-)
for even more info and a working example check here:
http://www.devx.com/webdev/discussions/101001/default.asp
read the section called "Create Excel Files Dynamically"
you can do the same thing for Word as well...
http://www.codeave.com/asp/code.asp?u_log=129
Good luck!
BRUNO
for even more info and a working example check here:
http://www.devx.com/webdev/discussions/101001/default.asp
read the section called "Create Excel Files Dynamically"
you can do the same thing for Word as well...
http://www.codeave.com/asp/code.asp?u_log=129
Good luck!
BRUNO
Do you want want to save the entire table including HTML tags or just the table contents?
Plus the article I posted could be used in what you require if you just read between the lines...
Plus the article I posted could be used in what you require if you just read between the lines...
ASKER
brunobear,
I don't question your ability to answer questions. =) I am just trying to figure out how to recall my function and add the
response.contenttype="appl ication/vn d-excel"
to it.
I don't question your ability to answer questions. =) I am just trying to figure out how to recall my function and add the
response.contenttype="appl
to it.
understood. :-)
check the links, there is some example code there. If you need more help, feel free to post some of your code and perhaps we can help a bit that way.
you might want to have the table created on it's own page, we had something similar to this and on the one page the user could choose which fields they wanted exported, and then they clicked the submit button, it went to the next page where it grabbed the correct fields and exported as Excel.
BRUNO
check the links, there is some example code there. If you need more help, feel free to post some of your code and perhaps we can help a bit that way.
you might want to have the table created on it's own page, we had something similar to this and on the one page the user could choose which fields they wanted exported, and then they clicked the submit button, it went to the next page where it grabbed the correct fields and exported as Excel.
BRUNO
ASKER
Sorry, to leave this open for so long. I sorta forgot about it.
Thanks to all who submitted suggestions! =)
-m
Thanks to all who submitted suggestions! =)
-m
mudface,
thanks for coming back, and thanks for the A!
BRUNO
thanks for coming back, and thanks for the A!
BRUNO
ASKER
Is there anyway to do this from within the client's <script language="vbscript"> tag?