怎样将html格式的table导成Execl
我现在想在已经生成查询出结果的html格式的table导入Execl的文件,请问怎么做?
------解决方案--------------------function CellAreaExcel()
{
var oXL = new ActiveXObject( "Excel.Application ");
var oWB = oXL.Workbooks.Add();
var oSheet = oWB.ActiveSheet;
var Lenr = document.getElementById( 'TrackingReport1 ').rows.length;
for (i=0;i <Lenr;i++)
{
var Lenc = document.getElementById( 'TrackingReport1 ').rows(i).cells.length;
for (j=0;j <Lenc;j++)
{
//oSheet.Cells(i+1,j+1).value = TrackingReport.rows(i).cells(j).innerText;
oSheet.Cells(i+1,j+1).value = document.getElementById( 'TrackingReport1 ').rows(i).cells(j).title;
}
}
oXL.Visible = true;
}
在ie中设置服务器IP为受信任站点