AddZDaddress.js
Code [http://www.xueit.com]
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->/////////////////////////////////////////////////////////////////////////////////////////////////// ////DocName:信任站点地址添加--AddZDaddress.js ////Author:lify ////Company:Wavenet ////Date:2009-11-04 ////EditDate:2010-03-11 ////MainContent:Findings,Ajax And So On; ////////////////////////////////////////////////////////////////////////////////////////////////// var BelieveAddress='172.18.1.25/psc1';////配置地址配置程序时需要的配置地址 ////**********************************Excel 导入到WEB界面模板地址集合*******************************************// //////////////////////////飞行检测excel模板地址配置///////////////////////////////////////////////////////////// var template_path_FxjcExcelDatasIntoSqlDatas = "http://%22 believeaddress %22/NewReports/xls_template/飞行检测城镇污水厂进出水主要污染物浓度.xls"; //////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////***********************************************************************************************************// ////*********************************Excel 录入模板导入地址集合**********************************************// //////////////////////////月报导入excel地址配置////////////////////////////////// var template_path_month = "http://%22 believeaddress %22/NewReports/xls_template/上海市污水处理企业生产运行表.xls"; ///////////////////////////////////////////////////////////////////////////////// //////////////////////////年报导入excel地址配置////////////////////////////////// var template_path_year = "http://%22 believeaddress %22/NewReports/xls_template/上海市污水处理设施信息表.xls"; ////*********************************************************************************************************// //图片地址 var pic_path="http://%22 believeaddress %22/NewReports/"; /////////////////////////////////////////////////////////////////////////////////
再次,怎么样把页面数据读取到Excel中JS,如下:
YearReportLuRu.js
Code [http://www.xueit.com]
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->/////////////////////////////////////////////////////////////////////////////////////////////////// ////DocName:污水处理设施信息表(年报)-录入报表--YearReportLuRu.js ////Author:lify ////Company:Wavenet ////Date:2009-08-14 ////EditDate:2009-08-14 ////MainContent:Findings,Ajax And So On; /////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////添加正则表达式类///////////////////////////////////////////////////////////// document.write("<script language=\"javascript\" type=\"text/javascript\" src=\"js/RegularExpression.js\"><\/script>"); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function AutomateExcel3() { //alert(pic_path document.getElementById("ImgUrl").value);//测试 var xls = new ActiveXObject("Excel.Application"); xls.Visible = true; var newBook = xls.Workbooks.Open(template_path_year);//这里的Add方法里的参数是模板的路径 var oSheet=newBook.ActiveSheet; ////////////////////////////////////////////写入数据到模板中//////////////////////////////////////////////////////////// ///////////////法人单位名称///////////////////////////////////////////////////////////////////////////////////////////// oSheet.Cells(2,3).value = Trim(PT.rows[0].cells[1].innerText); ///////////////法人单位代码以及代表姓名///////////////////////////////////////////////////////////////////////////////////////////////// oSheet.Cells(2,9).value = Trim(PT.rows[0].cells[3].innerText); oSheet.Cells(2,13).value = Trim(PT.rows[0].cells[5].innerText); //////////////进出口三张表///////////////////////////////////////////////////////////////////////////////////////// oSheet.Cells(3,2).value=Trim(PT.rows[1].cells[1].innerText); oSheet.Cells(3,6).value=Trim(PT.rows[1].cells[3].innerText); oSheet.Cells(3,8).value=Trim(PT.rows[1].cells[5].innerText); oSheet.Cells(3,10).value=Trim(PT.rows[1].cells[7].innerText); oSheet.Cells(3,13).value=Trim(PT.rows[1].cells[9].innerText); oSheet.Cells(4,2).value=Trim(PT.rows[2].cells[1].innerText); oSheet.Cells(4,4).value=Trim(PT.rows[2].cells[3].innerText); oSheet.Cells(4,6).value=Trim(PT.rows[2].cells[5].innerText); oSheet.Cells(4,8).value=Trim(PT.rows[2].cells[7].innerText); oSheet.Cells(4,10).value=Trim(PT.rows[2].cells[9].innerText); oSheet.Cells(4,12).value=Trim(PT.rows[2].cells[11].innerText); oSheet.Cells(4,14).value=Trim(PT.rows[2].cells[13].innerText); oSheet.Cells(5,2).value=Trim(PT.rows[3].cells[1].innerText); oSheet.Cells(5,5).value=Trim(PT.rows[3].cells[3].innerText); oSheet.Cells(5,8).value=Trim(PT.rows[3].cells[5].innerText); oSheet.Cells(5,10).value=Trim(PT.rows[3].cells[7].innerText); oSheet.Cells(5,12).value=Trim(PT.rows[3].cells[9].innerText); oSheet.Cells(5,14).value=Trim(PT.rows[3].cells[11].innerText); //////////////年运行简况/////////////////////// oSheet.Cells(6,4).value = Trim(PT.rows[4].cells[3].innerText); oSheet.Cells(6,6).value = Trim(PT.rows[4].cells[5].innerText); oSheet.Cells(6,8).value = Trim(PT.rows[4].cells[7].innerText); oSheet.Cells(6,10).value = Trim(PT.rows[4].cells[9].innerText); oSheet.Cells(6,12).value = Trim(PT.rows[4].cells[11].innerText); oSheet.Cells(6,14).value = Trim(PT.rows[4].cells[13].innerText); oSheet.Cells(7,4).value = Trim(PT.rows[5].cells[2].innerText); oSheet.Cells(7,6).value = Trim(PT.rows[5].cells[4].innerText); oSheet.Cells(7,8).value = Trim(PT.rows[5].cells[6].innerText); oSheet.Cells(7,10).value = Trim(PT.rows[5].cells[8].innerText); oSheet.Cells(7,12).value = Trim(PT.rows[5].cells[10].innerText); oSheet.Cells(7,14).value = Trim(PT.rows[5].cells[12].innerText); //////////////年处理水量/////////////////////// oSheet.Cells(8,2).value = Trim(PT.rows[6].cells[1].innerText); oSheet.Cells(8,5).value = Trim(PT.rows[6].cells[3].innerText); oSheet.Cells(8,8).value = Trim(PT.rows[6].cells[5].innerText); oSheet.Cells(8,11).value = Trim(PT.rows[6].cells[7].innerText); oSheet.Cells(8,14).value = Trim(PT.rows[6].cells[9].innerText); //////////////污水厂工艺概况/////////////////////// oSheet.Cells(10,3).value = Trim(PT.rows[8].cells[1].innerText); oSheet.Cells(10,4).value = Trim(PT.rows[8].cells[2].innerText); oSheet.Cells(10,5).value = Trim(PT.rows[8].cells[3].innerText); oSheet.Cells(10,7).value = Trim(PT.rows[8].cells[4].innerText); oSheet.Cells(11,3).value = Trim(PT.rows[9].cells[1].innerText); oSheet.Cells(11,4).value = Trim(PT.rows[9].cells[2].innerText); oSheet.Cells(11,5).value = Trim(PT.rows[9].cells[3].innerText); oSheet.Cells(11,7).value = Trim(PT.rows[9].cells[4].innerText); oSheet.Cells(12,3).value = Trim(PT.rows[10].cells[1].innerText); oSheet.Cells(12,4).value = Trim(PT.rows[10].cells[2].innerText); oSheet.Cells(12,5).value = Trim(PT.rows[10].cells[3].innerText); oSheet.Cells(12,7).value = Trim(PT.rows[10].cells[4].innerText); //--------------------------运行费用分析-------------------------------------// oSheet.Cells(13,3).value = Trim(PT.rows[11].cells[2].innerText); oSheet.Cells(13,5).value = Trim(PT.rows[11].cells[4].innerText); oSheet.Cells(13,7).value = Trim(PT.rows[11].cells[6].innerText); oSheet.Cells(13,9).value = Trim(PT.rows[11].cells[8].innerText); ////////////////////////////////厂外输送泵站示意图//////////////////////////// //copy(document.getElementById("ImgUrl")); //oSheet.Pictures.Insert(pic_path document.getElementById("ImgUrl").value);///////.Cells(13,11) var msoShaoeRectangle = 1;//AddShape(透明度,左,上,宽度,高度) oSheet.Shapes.AddShape(msoShaoeRectangle, 560, 330, 200, 150).Fill.UserPicture(pic_path document.getElementById("ImgUrl").value); //oSheet.Cell(13,11).select();//选中excel的单元格 //oSheet.Pictures.Insert(PT.rows[11].cells[8].getElementById("ImgUrl").src); ////////////////////////////////////////////////////////////////////////////// oSheet.Cells(14,3).value = Trim(PT.rows[12].cells[1].innerText); oSheet.Cells(14,5).value = Trim(PT.rows[12].cells[3].innerText); oSheet.Cells(14,7).value = Trim(PT.rows[12].cells[5].innerText); oSheet.Cells(14,9).value = Trim(PT.rows[12].cells[7].innerText); oSheet.Cells(15,3).value = Trim(PT.rows[13].cells[1].innerText); oSheet.Cells(15,5).value = Trim(PT.rows[13].cells[3].innerText); oSheet.Cells(15,7).value = Trim(PT.rows[13].cells[5].innerText); oSheet.Cells(15,9).value = Trim(PT.rows[13].cells[7].innerText); oSheet.Cells(16,5).value = Trim(PT.rows[14].cells[1].innerText); oSheet.Cells(16,7).value = Trim(PT.rows[14].cells[3].innerText); oSheet.Cells(16,9).value = Trim(PT.rows[14].cells[5].innerText); oSheet.Cells(17,3).value = Trim(PT.rows[15].cells[1].innerText); oSheet.Cells(17,5).value = Trim(PT.rows[15].cells[3].innerText); oSheet.Cells(17,7).value = Trim(PT.rows[15].cells[5].innerText); //---------------------------------------------------------------------------// //////////////污水厂表下方信息/////////////////////// oSheet.Cells(18,2).value = Trim(RT.rows[0].cells[1].innerText); oSheet.Cells(18,7).value = Trim(RT.rows[0].cells[3].innerText); oSheet.Cells(18,11).value = Trim(RT.rows[0].cells[5].innerText); oSheet.Cells(18,14).value = Trim(RT.rows[0].cells[7].innerText); /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// xls.Visible = true; xls.UserControl = true; xls = null; idTmr = window.setInterval("Cleanup();",1); //xls.quit(); } function Cleanup() { window.clearInterval(idTmr); CollectGarbage(); } function copy(tabid){ var oControlRange = document.body.createControlRange(); oControlRange.add(tabid,0); oControlRange.select(); document.execCommand("Copy"); }
发表评论
-
dssddssdsdsd
2014-07-02 17:22 817登录不要刷新发布文章没有判断内容是否为空您正在使用低版本浏览 ... -
hello
2014-07-02 17:22 707登录不要刷新发布文章没有判断内容是否为空您正在使用低版本浏览 ... -
用js获取后台返回的List对象
2013-05-17 10:59 1678function getEquimentType(){ ... -
Calendar注意
2013-03-27 19:41 819public static void main(String ... -
如何判断一个点是否在不规则图形内部?
2012-09-26 09:46 5943网上查了下,有办法是说连接目标点与各顶点,然后算夹角,加起来为 ... -
界面设计工具UIDesigner或者GUI
2012-09-19 16:14 595UI Designer,http://uid.cdc.t ... -
poi数据有效性(下拉列表)
2012-08-28 12:14 3110版本poi3.8 public class Test ... -
oracle
2012-05-23 22:45 709oracle -
项目部署至tomcat,访问地址不需要工程名 直接就是个ip地址
2012-04-10 15:17 1596在正常情况下我们访问项目连接都带工程名,如http://192 ... -
struts1
2011-08-02 07:34 807个人struts1 -
spring bean 范围
2011-05-19 21:07 758<bean id="bean1" c ... -
内存分析
2011-05-19 17:50 774CastorMarshaller -
推荐好的软件
2011-05-09 16:31 814类似windows的资源管理器:CubicExplorer.e ... -
多个包应用事务
2011-03-16 22:45 990<aop:config><aop:advis ... -
spring切面
2011-03-16 22:32 743<!-- [if gte mso 9]><x ... -
ext 事件
2011-03-02 00:17 862function btnClick(button,e){ ... -
extjs分页添加pagesize
2011-02-22 22:17 3746var tool_bar_1 = new Ext.Pagin ... -
Extjs分页添加每页显示条数
2011-02-22 21:57 5729PagingToolbar 设置每页条数 ... -
springmvc配置
2011-02-21 00:11 860<servlet> &l ... -
springmvc注解
2011-02-21 00:10 1178@Controller @RequestMapping(&q ...
相关推荐
实现javascript操作Excel进行报表输出的javabean接口类,通过调用bean的方法快速生成客户端的javascript来操作Excel,实现读取Excel模板,添加记录,打印设置,打印预览,自动保存文件等功能,本人多年的web开发经验...
本人是在实际项目中摸索出,JS读写Excel(模板)数据,包括怎么用JS把图片插入Excel中。首先,添加一个公用的模板地址JS,如下: AddZDaddress.js 代码如下: /////////////////////////////////////////////////////...
纯JavaScript实现json格式数据导出到Excel文件,支持多个Sheet页导出
js-excel-template 在浏览器或nodejs环境中使用的js excel模板。安装npm i js-excel-template 特征根据Excel模板生成Excel (对于nodejs)读取excel文件作为模板(适用于nodejs)写入Excel文件(用于nodejs)到...
JS数据导出Excel案例代码,通过JS数组形式把数据导出成Excel文件格式
通过JavaScript直接将页面上表格中的数据进行导出,导出到excel表格当中 可适用于boostrap前端模板样式
javascript 操作Word和Excel的实现代码
js导出excel
使用JavaScript中的ActiveXObject填充并设置Excel格式
使用js导出带样式的excel表格模板,有demo
nodejs excel模板引擎。 节点导出excel,ejsExcel 如何使用? npm install ejsexcel 怎么测试? 执行test / test.bat test/test.bat test / test.xlsx为完整示例demo 例如 const ejsexcel = require ( ...
所有这些都在提供JavaScript对象的上下文中。 如果您了解故事,请检查 。 很少有例子可以解释这一切 考虑以下JSON: { " title " : " An exemplary title " , " rows " : [ { " header " : " Row 1 " , ...
前端导出excel,可以控制样式,单元格合并居中等
并添加批注,注:由于批注只能加1000条,会在Excel后面添加一栏错误信息)下载以及页面展示校验错误信息,同时添加导入进度条,提供页面js和css代码,后端controller和service,提供xml模板和Excel模板,由于项目导入...
一个上传图片并自动写入数据库的压缩包,包括layui搜索,删除等等
javascript编写的excel导出模板。。
本人花费了一周的时间,经过无数次修改才制作完成,只需输入数据,其他的让电脑完成。我可爱的电子表格EXCEL
vue导出excel并修改表头样式(请先阅读readme) 安装npm install 执行npm run serve
本人是在实际项目中摸索出,JS读写Excel(模板)数据,包括怎么用JS把图片插入Excel中。 首先,添加一个公用的模板地址JS,