Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to export data using html table information which is displayed ?

Status
Not open for further replies.

philrm

MIS
Jun 1, 1999
58
AU
Hi all,

How to export data using html table information which is displayed on the screen to excel? Currently what the users have to do is drag the mouse over the html table and then click ctrl c to copy the information which is displayed as raw html table and then open up excel and paste it, which is quite time consuming. I wondering if it is possible to have the user click on a button and then automatically the html table gets exported into excel. I hope this make any sense ?
 
This code works for IE 4+ and Mozilla (NS 6):
Code:
<div id=&quot;myTable&quot;>
 <!-- Put your table here -->
</div>
<script type=&quot;text/javascript&quot;>
function doOutput(input, output) {
 var ie=document.all?1:0;
 input=ie?document.all[input]:document.getElementById(input);
 output=ie?document.all[output]:document.getElementById(output);
 output.innerHTML=input.innerHTML.replace(/&/,'&amp;amp;').replace(/</,'&amp;lt;').replace(/>/,'&amp;gt;');
}
</script>
<input type=&quot;button&quot; value=&quot;View the Table's HTML&quot; onclick=&quot;doOutput('myTable','myHTML')&quot;>
<div id=&quot;myHTML&quot;></div>
 
Hi UNIMENT

This is not what I wanted. I wanted the current Html table information which is displayed on the screen to be exported to execl when the user Click on the button called &quot;View the table in Excel&quot; ? That all I am wanting. Thanks
 
I do not know much about perl. Does it interact with coldfusion server. IE can the code be inserted inside a cfm page and work correctly. If so I will give it a go
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top