Index: ssts-web/src/main/webapp/homepage/exportMonitorData.jsp =================================================================== diff -u -r30931 -r31225 --- ssts-web/src/main/webapp/homepage/exportMonitorData.jsp (.../exportMonitorData.jsp) (revision 30931) +++ ssts-web/src/main/webapp/homepage/exportMonitorData.jsp (.../exportMonitorData.jsp) (revision 31225) @@ -3,46 +3,54 @@ <%@page import="java.io.IOException"%> <%@page import="sun.misc.BASE64Decoder"%> <%@ page import="com.forgon.tools.*,com.forgon.disinfectsystem.reportforms.service.*"%> - - + + + -
- - -
- + + + + +
+ + <% String fileName = request.getParameter("htmlFileName"); String jsFileName = request.getParameter("jsFileName"); + String htmlTable = request.getParameter("htmlTable"); if(fileName != null){ ServletOutputStream servletOutputStream = response.getOutputStream(); try{ response.setContentType("application/vnd.ms-excel"); response.addHeader("Content-Disposition","inline;filename=" + new String(fileName.getBytes("GBK"), "ISO8859_1")); ReportFormsManager reportFormsManager = (ReportFormsManager)SpringBeanManger.getBean("reportFormsManager"); - reportFormsManager.exportHtmlTable(request,servletOutputStream,jsFileName); + reportFormsManager.exportHtmlTable(request,servletOutputStream,jsFileName,htmlTable); }catch (Exception e) { e.printStackTrace(); } servletOutputStream.flush(); out.clear(); out = pageContext.pushBody(); } -%> \ No newline at end of file + %> \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/reportforms/qualityMonitoringView.js =================================================================== diff -u -r31150 -r31225 --- ssts-web/src/main/webapp/disinfectsystem/reportforms/qualityMonitoringView.js (.../qualityMonitoringView.js) (revision 31150) +++ ssts-web/src/main/webapp/disinfectsystem/reportforms/qualityMonitoringView.js (.../qualityMonitoringView.js) (revision 31225) @@ -400,30 +400,17 @@ function exportExcel(data,thisID) { var fileName = data.fileName + data.fileType; if (isIE()) { - var url = WWWROOT + '/jasperreports/jasperreportsAction!saveExportHtmlTableInfo.do'; var tableHtml = ''; tableHtml += data.html; tableHtml += ''; tableHtml = Base64.encode(encodeURI(tableHtml)); - var params = { - htmlTable: LZString.compressToEncodedURIComponent(tableHtml) - } + var htmlTable = LZString.compressToEncodedURIComponent(tableHtml) var jsFileName = "\\disinfectsystem\\reportforms\\js\\LZString.js"; - sessionStorage.setItem('htmlFileName', fileName); - sessionStorage.setItem('jsFileName', jsFileName); - Ext.Ajax.request({ - url: url, - async: false, - params: params, - success: function (response) { - exportMask.hide(); - window.open(WWWROOT + '/homepage/exportMonitorData.jsp', "_blank"); - }, - failure: function (response, options) { - exportMask.hide(); - showResult(response.responseText); - } - }); + document.getElementById('thisIframe').contentWindow.document.getElementById('htmlFileName').value = fileName + '.xls'; + document.getElementById('thisIframe').contentWindow.document.getElementById('jsFileName').value = jsFileName; + document.getElementById('thisIframe').contentWindow.document.getElementById('htmlTable').value = htmlTable; + document.getElementById('thisIframe').contentWindow.document.getElementById('submitForm').click(); + exportMask.hide(); } else { XSExport.excelExport( thisID, @@ -555,8 +542,7 @@ } if (result.dataType == '质量监测' || result.dataType == '定期监测') { html = getTableHtml_2(result, title); } - - document.getElementById('thisIframe').contentWindow.document.body.innerHTML = html; + document.getElementById('thisIframe').contentWindow.document.getElementById('table').innerHTML = html; myMask.hide(); }, failure: function (response, options) { @@ -892,7 +878,7 @@ tbar: [{ text: '导出', handler: function () { - var html = document.getElementById('thisIframe').contentWindow.document.body.innerHTML; + var html = document.getElementById('thisIframe').contentWindow.document.getElementById('table').innerHTML; if (html !== '') { var startDate = $Id('startDate').value; var endDate = $Id('endDate').value; @@ -909,12 +895,12 @@ }); exportMask.show(); setTimeout(function(){ - exportExcel(data,document.getElementById('thisIframe').contentWindow.document.getElementById('frameTable')); + exportExcel(data,document.getElementById('thisIframe').contentWindow.document.getElementById('table')); }, 1000); } } }], - html: '' + html: '' }); var viewport = new Ext.Viewport({