Tag: jquery

Javascript / Jquery将文本parsing为excel

我是相当新的JavaScript,但我想可能创build一个jQuery的JavaScript,将逐行通过Excel表中的所有logging,并为每个loggingparsingTEXT文件中的单元格信息在一个和相同的 html样式的结构,如下面的一个。 | Cell1| IMG path | IMGthumbpath | Cell4| Cell5| Cell6 | Cell7 | xxx xxx xxx xxx xxx xxx xxx. … … … … … … … xls中每个logging的文本文件的结构: <!– Start of mark up image. –> <a href="../<content of IMG path cell>.jpg" class="Gallery" onClick="return xxx"> <[img] src="../<content of IMGthumbpath cell>.jpg" alt="<content of Cell1>" title="<content […]

PHP:将表导出到没有隐藏列的Excel

我试图在Excel中从PHP中导出表格。 一切都很好,但我需要在PHP中使用JQuery来隐藏一些列。 当我将带有隐藏列的表导出到Excel时,隐藏列将显示为零值。 这是我正在使用的代码: import_request_variables('P'); $title="Table Results"; $var= "Content-Disposition: attachment; filename=".$title.".xls"; header('Content-type: application/vnd.ms-excel'); header($var); echo $_POST['tableExcel']; tableExcel是一个表格。 有什么办法在导出到Excel时不包含隐藏的列? 谢谢

将jqgrid导出到excel中并不适用于jsp

大家好!! 我有一个jqgrid显示logging。现在根据我的要求,我必须将其导出为Excel格式。我试图做到这一点,但没有发生任何how.Export到Excelbutton不工作。在这里我发布我的代码… <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>JQgrid</title> <img src="images/header.png" alt="Logo" height="130" width="1270"/> <hr noshade size="3" align="left"> <script language="javaScript" type="text/javascript" src="calender.js"></script> <link href="calender.css" rel="stylesheet" type="text/css"> <link href="css/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css" /> <link href="css/ui.jqgrid.css" rel="stylesheet" type="text/css" /> <link href="css/style.css" rel="stylesheet" type="text/css" /> <link href="plugins/ui.multiselect.css" rel="stylesheet" type="text/css" /> <script src="js/jquery-1.5.2.min.js" type="text/javascript"></script> <script src="js/i18n/grid.locale-en.js" type="text/javascript"></script> <script src="js/jquery-ui-custom.min.js" […]

另存为DialogueBox在servlet response.setHeader中不起作用

我正在通过单击button将jqgrid中显示的数据导出到.excel文件中。 这里是我的代码导出到Excelbutton点击.. $('#excel').click(function(){ var fromdate=$('#fromdate').val(); var todate=$('#todate').val(); if(fromdate && todate) { var URL='excel?fromdate='+$('#fromdate').val()+'&todate='+$('#todate').val(); $.ajax({ url:URL, type:'GET', success:function(data){ alert('Exported To Excel'); } }); } }); 现在这个button将直接指向excel.java页面,这是servlet.Below是我的exceljava页面代码。现在我需要Asper当用户点击导出到excelbutton时打开一个对话框并保存为对话框应该popup,使用户能够给予所需名称和保存到所需的位置,但它不会发生这种code.plz指出我的错误.. excel.java try { response.setHeader("Content-Type", "application/vnd.ms-excel"); response.setHeader("Content-Disposition","attachment; filename=excel.xls"); String datum1 = request.getParameter("fromdate"); String datum2 = request.getParameter("todate"); SimpleDateFormat sdfSource = new SimpleDateFormat("dd-MM-yyyy"); Date date = sdfSource.parse(datum1); Date date2 = sdfSource.parse(datum2); SimpleDateFormat sdfDestination […]

使用格式化的CSS将HTML表格导出为使用Javascript或Jquery的Excel或PDF文件

我已经尝试了几个方法的Datatable方法,点击button也是这样的Javascript: <script type="text/javascript"> var tableToExcel = (function () { var uri = 'data:application/vnd.ms-excel;base64,', template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!–[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]–></head><body><table>{table}</table></body></html>', base64 = function (s) { return window.btoa(unescape(encodeURIComponent(s))) }, format = function (s, c) { return s.replace(/{(\w+)}/g, function (m, p) { return c[p]; }) } return function (table, name) { if (!table.nodeType) table = […]

Excel 2013应用程序,jQuery,WCF调用失败,出现“无传输”错误

编程环境是: – Windows 8桌面; – WCF服务; – Excel 2013办公应用程序; – WCF服务和Excel办公应用程序在同一台机器上运行; – 办公室应用程序对WCF服务进行ajax调用; 发生问题的JavaScript代码(在办公室应用程序中使用)是: function F() { $.support.cors = true; $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "http://localhost:5000/<service>/<method>", data: '{<my data>}', dataType: "json", success: … error: … }); } 这是我有的问题 – 当我从Excel 2013应用程序调用WCF服务时,我得到一个“无传输”错误。 我能够确定以下用例:1)只有当我运行独立的Excel 2013实例并从“插入”Excel菜单中插入应用程序时,才会发生这种情况。 2)如果我从VS2012运行应用程序,那么一切都很好,我可以调用WCF服务没有任何问题。 (顺便说一句,WCF服务运行在同一台机器上,我从Excel 2013应用程序中创build的请求是ajax)。 3)与(2)相同的情况。 该应用程序可以进行WCF调用。 然后我也从Excel的“插入”菜单插入我的应用程序的一个实例。 在这种情况下,如果我尝试使用插入的应用程序实例进行WCF调用,则会出现与(1)中相同的错误 – “无传输”。 我在互联网上进行了一些search,发现我的问题可能与我尝试进行的调用是跨域调用有关。 […]

有没有一个jQuery的GRID组件,允许前N列是固定的,而其他列水平滚动

我正在寻找一个像Excel编辑的jQuery GRID组件,允许我修复前N列,然后让其余的水平滚动。 它绝对必须是一个jQuery组件。 我已经检查了这个在这里的其他答案在stackoverflow,但他们肯定不够好 – 他们不支持像编辑Excel。 这是我检查出来的: HTML / jQuery Tables:水平滚动,修复第一个(左)列 水平滚动的HTML表格(第一列固定) 还有其他人,但他们甚至没有接近。

导出HTML5表格,以优秀的jQuery

我想出口我的HTML表格使用js或jQuery的Excel表格我search谷歌,但没有得到任何有用的资源。 这里是我的HTML表代码 <table> <thead id='headers'> <tr> <th>Select</th> <th>Name</th> <th>Mobile</th> <th>Mail ID</th> <th>Rating</th> <th>Date</th> <th>Notify</th> <th>View</th> </tr> </thead> <tbody> <tr> <td><input type="checkbox"/></td> <td>Praveen</td> <td>97910123123</td> <td>praveen@360i</td> <td>5 star</td> <td>15.2.2013</td> <td>A</td> <td>4</td> </tr> <tr> <td><input type="checkbox"/></td> <td>kumar</td> <td>97912342333</td> <td>kumar@360i</td> <td>4 star</td> <td>16.2.2013</td> <td>D</td> <td>3</td> </tr> </tbody> </table> 请帮我找出解决办法………

使用getJSON返回Excel电子表格

所以我有这个方法: public Microsoft.Office.Interop.Excel.Worksheet createDoc() { try { app = new Microsoft.Office.Interop.Excel.Application(); app.Visible = true; workbook = app.Workbooks.Add(1); worksheet = (Microsoft.Office.Interop.Excel.Worksheet)workbook.Sheets[1]; } catch (Exception e) { Console.Write("Error"); } finally { } return worksheet; } 我需要能够返回此工作表,并将其附加到我的观点中的HTML IFRAME。 我在Visual Studio中使用MVC4。 这里是我一直使用的代码来获得JSONResults,但我从来没有处理这个。 $.getJSON("/exceldocumentmethod", function (results) { }); 有什么build议?

当使用innerHTML导出数据时,我在我的excel中留有空白。 只有select和input

在td类编辑我只想显示导出select当前显示的select时,跨度类外观。 相反,它试图渲染一切,因此创造空白。 <tr class="proj_rec" data-id="4"> <td class="proj_id"> 4 </td> <td> Music in the stores </td> <td class="edit"> <select class="touch" style="display: none;"> <option value="13">Bloopers</option><option value="1">Customer Service</option><option value="2">DC</option><option value="3">Ecommerce</option><option value="4">Finance/Accounting</option><option value="5">Human Resources</option><option value="6">Inbound Logistics</option><option value="7">Information Systems</option><option value="14">Management</option><option value="8">Marketing</option><option value="9">Merchandising</option><option value="10">Property</option><option value="11">Rebuying</option><option value="12">Sales</option> </select> <span class="look"> Sales </span> </td> <td class="edit"> <select class="touch" style="display: none;"> <option value="1">As is […]