[thelist] Export page to excel

Amazon Paulo Amazon.Paulo at Amazoniacelular.com.br
Tue Jun 18 08:59:05 CDT 2002


Thanks to Anthony, Ron and Ray. All the sugestions are very interesting and
I'm impressed how many different ways exist to do this.

I've made in another manner (I need to do this in javascript):

<script language=javascript>
function exportToExcel()
{
var oExcel = new ActiveXObject("Excel.Application");
var oBook = oExcel.Workbooks.Add;
var oSheet = oBook.Worksheets(1);
for (var y=0;y<detailsTable.rows.length;y++)
// detailsTable is the table where the content to be exported is
{
	for (var x=0;x<detailsTable.rows(y).cells.length;x++)
	{
		oSheet.Cells(y+1,x+1) =
detailsTable.rows(y).cells(x).innerText;
	}
}
oExcel.Visible = true;
oExcel.UserControl = true;
}
</script>

<button onclick="exportToExcel();">Export to Excel File</button>

It's almost done. I'm having formatting issues, now...

Paulo Guedes



More information about the thelist mailing list