将Table数据导出至Excel文件(中国移动实现的方式)
2009-02-05 17:13
806 查看
JS方法:
<script type="text/javascript">
function excelPrint(objStr){
var tempStr = document.getElementById('sort_table').outerHTML;
var newWin = window.open();
newWin.document.write(tempStr);
newWin.document.close();
newWin.document.execCommand('saveas',true,objStr+'.xls');
newWin.window.close();
}
</script>
调用:
<input type="button" name="button2" value="导出EXCEL表格" onclick="excelPrint('13838325555,01月01日--01月25日详单');" style="cursor:hand"/>
<script type="text/javascript">
function excelPrint(objStr){
var tempStr = document.getElementById('sort_table').outerHTML;
var newWin = window.open();
newWin.document.write(tempStr);
newWin.document.close();
newWin.document.execCommand('saveas',true,objStr+'.xls');
newWin.window.close();
}
</script>
调用:
<input type="button" name="button2" value="导出EXCEL表格" onclick="excelPrint('13838325555,01月01日--01月25日详单');" style="cursor:hand"/>
相关文章推荐
- 将Table数据导出至Excel文件(中国移动实现的方式)
- 将Table数据导出至Excel文件(中国移动实现的方式)
- 将Table数据导出至Excel文件(中国移动实现的方式)
- pb9中使用htmltable方式将数据窗口导出为excel文件的几点看法
- Java程序员从笨鸟到菜鸟之(一百零五)java操作office和pdf文件(三)利用jxl实现数据导出excel报表以及与POI的区别
- Java导出页面数据或数据库数据至Excel文件并下载,采用JXL技术,小demo(servlet实现)
- php导出 excel文件 实现方式
- Java程序员从笨鸟到菜鸟之(一百零四)java操作office和pdf文件(二)利用POI实现数据导出excel报表
- 结合bootstrap fileinput插件和Bootstrap-table表格插件,实现文件上传、预览、提交的导入Excel数据操作流程
- jws 方式表格导出,excel文件导出,rest风格接口实现
- Java程序员从笨鸟到菜鸟之(一百零五)java操作office和pdf文件(三)利用jxl实现数据导出excel报表以及与POI的区别
- Jsp中的table多表头导出excel文件具体实现
- js table数据导出excel文件
- Jsp中的table多表头导出excel文件具体实现
- 上传excel文件实现批量导入数据及导出数据为excel文件
- Java Web获取数据库数据,利用jxl实现数据导出成Excel文件
- 【代码实现】PHP导入Excel和导出数据为Excel文件
- MVC 实现表格数据导出Excel(NPOI方式)
- 基于Spring3 MVC实现批量导出数据成Excel文件!
- jqgrid实现客户端导出Excel、txt、word、json等数据格式的文件