From: <Se...@us...> - 2012-10-22 18:43:23
|
Revision: 6448 http://jaffa.svn.sourceforge.net/jaffa/?rev=6448&view=rev Author: SeanZ Date: 2012-10-22 18:43:16 +0000 (Mon, 22 Oct 2012) Log Message: ----------- enable to add sheetName to excel sheet. Modified Paths: -------------- trunk/JaffaRIA/source/html/js/extjs/jaffa/finder/exportToExcel.jsp trunk/JaffaRIA/source/html/js/extjs/ux/plugins/ExportToExcelPlugin.js Modified: trunk/JaffaRIA/source/html/js/extjs/jaffa/finder/exportToExcel.jsp =================================================================== --- trunk/JaffaRIA/source/html/js/extjs/jaffa/finder/exportToExcel.jsp 2012-10-21 00:55:27 UTC (rev 6447) +++ trunk/JaffaRIA/source/html/js/extjs/jaffa/finder/exportToExcel.jsp 2012-10-22 18:43:16 UTC (rev 6448) @@ -554,8 +554,11 @@ } } String excelTable = generateExcel(master, child); +String sheetName = request.getParameter("sheetName"); +if (sheetName==null) sheetName = "exportToExcel.xls"; +else sheetName += ".xls"; response.setContentType("application/vnd.ms-excel"); -response.setHeader("Content-Disposition", "attachment; filename=\"exportToExcel.xls\""); +response.setHeader("Content-Disposition", "attachment; filename=\""+sheetName+"\""); %> <html xmlns:x="urn:schemas-microsoft-com:office:excel"> <head> Modified: trunk/JaffaRIA/source/html/js/extjs/ux/plugins/ExportToExcelPlugin.js =================================================================== --- trunk/JaffaRIA/source/html/js/extjs/ux/plugins/ExportToExcelPlugin.js 2012-10-21 00:55:27 UTC (rev 6447) +++ trunk/JaffaRIA/source/html/js/extjs/ux/plugins/ExportToExcelPlugin.js 2012-10-22 18:43:16 UTC (rev 6448) @@ -62,6 +62,7 @@ method:'POST', action : params.appCtx + (config.jspPath?config.jspPath:'/js/extjs/jaffa/finder/exportToExcel.jsp') }); + if (config.sheetName) Ext.DomHelper.append(form, {tag:'input', type:'hidden', name:'sheetName', value:config.sheetName}); Ext.DomHelper.append(form, {tag:'input', type:'hidden', name:'serviceClassName', value:config.serviceClassName}); if (config.serviceClassMethodName) Ext.DomHelper.append(form, {tag:'input', type:'hidden', name:'serviceClassMethodName', value:config.serviceClassMethodName}); @@ -119,7 +120,7 @@ form.submit(); setTimeout(function(){Ext.removeNode(form);}, 100); - } + } }; if (grid.rendered){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |