baidu_29643173 2015-10-27 09:18 采纳率: 0%
浏览 1877

java网页导出excel为什么在兼容模式下时而好使时而不好使,极速模式没问题

java网页导出excel为什么在兼容模式下时而好使时而不好使,极速模式没问题。求大神指点。

下面是导出代码和excel的JSP文件开头。

  /**
     * 导出Excel
     * @return
     * @throws Exception
     */
    public String getListExcel() throws Exception
    {
        this.init();
        chuKuList = dao.getList(startTime,endTime,shouHuoDanWei,cheHao,pinMing);
        //页面核算

        for(int i =0;i<chuKuList.size();i++){
         ChuKu chuKu=chuKuList.get(i);
            heji1=heji1+chuKu.getDanJia();
            he1 = TypeChange.stringToDouble(df.format(heji1));
            heji2=heji2+chuKu.getJinE();
            he2 = TypeChange.stringToDouble(df.format(heji2));
            heji3=heji3+chuKu.getZhuangCheFei();
            he3 = TypeChange.stringToDouble(df.format(heji3));
            heji4=heji4+chuKu.getYunFei();
            he4 = TypeChange.stringToDouble(df.format(heji4));
            heji5=heji5+chuKu.getZongJinE();
            he5 = TypeChange.stringToDouble(df.format(heji5));
            heji6=heji6+chuKu.getMaoZhong();
            he6 = TypeChange.stringToDouble(df.format(heji6));
            heji7=heji7+chuKu.getPiZhong();
            he7 = TypeChange.stringToDouble(df.format(heji7));
            heji8=heji8+chuKu.getJingZhong();
            he8 = TypeChange.stringToDouble(df.format(heji8));
            heji9=heji9+chuKu.getDanJianZhongLiang();
            he9 = TypeChange.stringToDouble(df.format(heji9));
        }
         return SUCCESS;
    }
 <%@ page contentType="application/vnd.ms-excel; charset=UTF-8" %>
<%@ page import="com.sysgrrj.common.TypeChange" %>
<%@  taglib prefix="s" uri="/struts-tags" %>
<% String f = "出库信息" + TypeChange.GetDate() + ".xls";
    response.addHeader("Content-Disposition", "filename=" + new String(f.getBytes(), "iso8859-1")); %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

        <style type="text/css">
            body, p, td {
            font-family: '宋体';
            font-size: 12px;
            }
        </style>
  • 写回答

1条回答 默认 最新

  • 我是主厨 2015-10-28 03:18
    关注

    这个应该是兼容问题吧。你用的IE吧?

    评论

报告相同问题?

悬赏问题

  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?