欢迎来到天天文库
浏览记录
ID:17399210
大小:22.18 KB
页数:17页
时间:2018-08-30
《web页面导出为excel文档的方法(the method of exporting web pages to excel documents)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、web页面导出为excel文档的方法(ThemethodofexportingwebpagestoEXCELdocuments)ThemethodofexportingWEBpagestoEXCELdocuments(JSimplementationandcollation)2、.w3.org/1999/xhtml">MethodofexportingWEBpagestoEXCELdocumentsyufeiwelcomeyou3、,4、Excel',null)";"value="importthirdmethodstoEXCEL>//theentiretabletocopyinEXCELFunctionmethod1(tableid){VarcurTbl=document.getElementById(tableid);VaroXL=newActiveXObject("Excel.Application");//createaAXobjectExcelVar=oXL.Workbooks.Add(oWB);//get5、theworkbookobjectVaroSheet=oWB.ActiveSheet;//sheetactivatedcurrentVarsel=document.body.createTextRange();Sel.moveToElementText(curTbl);//putthecontentsofthetabletoTextRangeSel.select(TextRange);//selectcontentSel.execCommand("Copy");//copycontentinTextRange(oSheet.Paste);/6、/pastetotheactivitiesofEXCELVarXLObj=newActiveXObject("Excel.Application");VarxlBook=XLObj.Workbooks.Add;//newworkbookVarExcelSheet=xlBook.Worksheets(1);//createaworktable2.savetheformExcelSheet.SaveAs("C:\TEST.XLS");3.makeExcelvisiblethroughApplicationobjectsExcelSheet.A7、pplication.Visible=true;4.printingXlBook.PrintOut;Or:ExcelSheet.PrintOut;5.closeXlBook.Close(savechanges=false);Or:ExcelSheet.Close(savechanges=false);6.endprocessExcelSheet.Application.Quit();Or:XLObj.Quit();XLObj=null;7.pagesettingsExcelSheet.ActiveSheet.PageSetup.LeftMa8、rgin=2/0.035;//leftmarginsof2cmExcelSheet.ActiveSheet.PageSetup.RightMargin=3/0.035;Right
2、.w3.org/1999/xhtml">
3、,
4、Excel',null)";"value="importthirdmethodstoEXCEL>//theentiretabletocopyinEXCELFunctionmethod1(tableid){VarcurTbl=document.getElementById(tableid);VaroXL=newActiveXObject("Excel.Application");//createaAXobjectExcelVar=oXL.Workbooks.Add(oWB);//get
5、theworkbookobjectVaroSheet=oWB.ActiveSheet;//sheetactivatedcurrentVarsel=document.body.createTextRange();Sel.moveToElementText(curTbl);//putthecontentsofthetabletoTextRangeSel.select(TextRange);//selectcontentSel.execCommand("Copy");//copycontentinTextRange(oSheet.Paste);/
6、/pastetotheactivitiesofEXCELVarXLObj=newActiveXObject("Excel.Application");VarxlBook=XLObj.Workbooks.Add;//newworkbookVarExcelSheet=xlBook.Worksheets(1);//createaworktable2.savetheformExcelSheet.SaveAs("C:\TEST.XLS");3.makeExcelvisiblethroughApplicationobjectsExcelSheet.A
7、pplication.Visible=true;4.printingXlBook.PrintOut;Or:ExcelSheet.PrintOut;5.closeXlBook.Close(savechanges=false);Or:ExcelSheet.Close(savechanges=false);6.endprocessExcelSheet.Application.Quit();Or:XLObj.Quit();XLObj=null;7.pagesettingsExcelSheet.ActiveSheet.PageSetup.LeftMa
8、rgin=2/0.035;//leftmarginsof2cmExcelSheet.ActiveSheet.PageSetup.RightMargin=3/0.035;Right
此文档下载收益归作者所有