xls导出,在过滤过导出只有头没有数据是怎么搞得
s1good
2007-05-30
xls导出,在过滤过导出只有头没有数据是怎么搞得
|
|
fins
2007-05-30
提供的条件太少不便于定位问题
请多提供点信息 例如您的jsp和后台代码 |
|
s1good
2007-05-31
dome!!
<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="gb2312" import ="java.util.ArrayList,java.util.List,java.util.HashMap,java.util.Map,java.sql.*,java.io.*;"%> <%@ taglib uri="../WEB-INF/ecside.tld" prefix="ec" %> <%@ include file="check_d.jsp"%> <% String xsyid = String.valueOf(session.getAttribute("xsyid")); String xsyid_tmp=xsyid.substring(9,10); String xsyid_tmp2=xsyid.substring(0,2); if (!xsyid_tmp.equals("1")&&!xsyid_tmp.equals("2")&&!xsyid_tmp2.equals("kf")) { out.println("<script>alert(\"你没有权限\");window.location.href=\"main.jsp\"</script>"); } String sql=""; //request.setCharacterEncoding("gb2312"); sql = "select * from gm_v ORDER BY id desc"; conbeans.executeQuery(sql); List userList=new ArrayList(); Map userInfo=null; while (conbeans.next()) { userInfo=new HashMap(); userInfo.put("id",conbeans.getInt("did")); userInfo.put("name",conbeans.getString("name")); userInfo.put("sex",conbeans.getString("sex")); userInfo.put("tel",conbeans.getString("tel")); userInfo.put("stime",conbeans.getString("stime").substring(0,10)); userInfo.put("etime",conbeans.getString("etime").substring(0,10)); userInfo.put("qian",conbeans.getString("qian")); userInfo.put("sj",conbeans.getString("sj").substring(0,10)); userInfo.put("gmname",conbeans.getString("gmname")); if(conbeans.getString("jkrq")==null) userInfo.put("jkrq","未知"); else userInfo.put("jkrq",conbeans.getString("jkrq").substring(0,10)); if(conbeans.getString("sp").equals("0")) userInfo.put("sp","<a HREF=\"javascript:;\" onClick=\"openWin('kfsp_ok.jsp?id="+conbeans.getInt("did")+"',280,60)\">待审批</a>"); else userInfo.put("sp",conbeans.getString("sp")); userList.add(userInfo); } String webapp=request.getContextPath(); request.setAttribute("records",userList); %> <html> <head> <jsp:include page="../common_head.jsp" flush="true" /> <script> function openWin(htmUrl,w,h) { var url=htmUrl; //要打开的窗口 var winName="newWin"; //给打开的窗口命名 var awidth=w; var aheight=h; var atop=(screen.availHeight - aheight)/2; //窗口顶部位置,一般不需要改 var aleft=(screen.availWidth - awidth)/2; //窗口放中央,一般不需要改 var param0="location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes"; //新窗口的参数 var params="top=" + atop + ",left=" + aleft + ",width="+w+",height="+h+ param0 ; win=window.open(url,winName,params); //打开新窗口 win.focus(); //新窗口获得焦点 } </script> <style type="text/css"> <!-- .STYLE99 {color: #FF0000} --> </style> </head> <body style="margin:10px;" > <ec:table items="records" var="record" retrieveRowsCallback="process" useAjax="true" doPreload="false" action="${pageContext.request.contextPath}/conntent/kfsp.jsp" title="客服成交客户管理" pageSizeList="15,20,50,100,500,1000" rowsDisplayed="15" xlsFileName="out.xls" showPrint="true" width="840" listWidth="100%" height="480px" sortable="true" filterable="true" > <ec:row > <ec:column width="6%" property="_0" title="序号" value="${GLOBALROWCOUNT}" /> <ec:column width="7%" property="name" title="用户名"/> <ec:column width="6%" property="sex" title="性别"/> <ec:column width="11%" property="tel" title="用户电话"/> <ec:column width="10%" property="stime" title="开始时间"/> <ec:column width="10%" property="etime" title="结束时间"/> <ec:column width="11%" property="sj" title="成交录入时间"/> <ec:column width="7%" property="gmname" title="成交人"/> <ec:column width="11%" property="jkrq" title="交款时间"/> <ec:column width="9%" property="s" title="操作" > <a HREF="javascript:;" onClick="openWin('kfsp_edit.jsp?action=ed&id=${record.id}',520,260)">编辑</a> <a HREF="javascript:;" onClick="openWin('kfsp_del.jsp?id=${record.id}',280,60)">删除</a> </ec:column> <ec:column width="6%" property="sp" title="审批人"/> <ec:column width="6%" property="qian" title="交款" editable="false" resizeColWidth="false" format="0.00" calc="average,total" calcTitle= "平均,合计" calcSpan="2" ></ec:column> </ec:row> </ec:table> <textarea id="ecs_t_input" rows="" cols="" style="display:none"> <input type="text" class="inputtext" value="" onblur="ECSideUtil.updateEditCell(this)" style="width:100%;" name="" /> </textarea> </body> </html> |
|
fins
2007-05-31
你这种把一切都写进jsp的做法实在让我难以分析问题所在
能否代码重构一下 不该在jsp里做的事就不要在jsp里做 |
相关讨论
相关资源推荐
- Dojo 加载器源文件 dojo.js
- dojo 加载器源文件讲解
- DOJO API 中文参考手册
- ARCGIS GeoJsonLayer.js
- Dojo - Creating a custom widget创建自定义小部件
- DOJO DIJIT.TREE 入门
- dojo创建浮动工具栏_创建由Dojo驱动的WordPress网站视图
- dojo框架笔记
- dojo创建浮动工具栏_使用Dojo工具包创建动态Flickr图像搜索
- http://www.useragentman.com/blog/2010/07/27/creating-cross-browser-html5-forms-now-using-modernizr-w