POI导出Excel时,最后的HSSFWorkbook的write执行后没有反应是为什么? 10
附上代码:Stringagent=request.getHeader("USER-AGENT");filename+=".xls";filename.replaceAll...
附上代码:
String agent = request.getHeader("USER-AGENT");
filename += ".xls";
filename.replaceAll("/", "-");
// filename = new String(filename.getBytes("gbk"),"ISO8859_1");
if (agent.toLowerCase().indexOf("firefox")>0)
{
filename = new String(filename.getBytes("utf-8"), "iso-8859-1");
}else{
filename = URLEncoder.encode(filename, "UTF-8");
}
response.reset();
response.setCharacterEncoding("UTF-8");
response.setHeader("Content-Disposition", "attachment; filename=" + filename);
response.setContentType("application/octet-stream;charset=UTF-8");
OutputStream outputStream = new BufferedOutputStream(response.getOutputStream());
wb.write(outputStream);
outputStream.flush();
outputStream.close(); 展开
String agent = request.getHeader("USER-AGENT");
filename += ".xls";
filename.replaceAll("/", "-");
// filename = new String(filename.getBytes("gbk"),"ISO8859_1");
if (agent.toLowerCase().indexOf("firefox")>0)
{
filename = new String(filename.getBytes("utf-8"), "iso-8859-1");
}else{
filename = URLEncoder.encode(filename, "UTF-8");
}
response.reset();
response.setCharacterEncoding("UTF-8");
response.setHeader("Content-Disposition", "attachment; filename=" + filename);
response.setContentType("application/octet-stream;charset=UTF-8");
OutputStream outputStream = new BufferedOutputStream(response.getOutputStream());
wb.write(outputStream);
outputStream.flush();
outputStream.close(); 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励10(财富值+成长值)+提问者悬赏10(财富值+成长值)
4个回答
2016-01-15 · 知道合伙人软件行家
关注
展开全部
输入代码:
$pngname = $openid.'.png';
if(imagepng($QR, $pngname)){
imagedestroy($QR);
$qrurl = W_DOMAIN.''.$pngname;
$this->assign('qrcode',$qrurl);
$this->display();
}
$pngname = $openid.'.png';
if(imagepng($QR, $pngname)){
imagedestroy($QR);
$qrurl = W_DOMAIN.''.$pngname;
$this->assign('qrcode',$qrurl);
$this->display();
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2016-02-23 · 知道合伙人软件行家
关注
展开全部
$pngname = $openid.'.png';
if(imagepng($QR, $pngname)){
imagedestroy($QR);
$qrurl = W_DOMAIN.''.$pngname;
$this->assign('qrcode',$qrurl);
$this->display();
if(imagepng($QR, $pngname)){
imagedestroy($QR);
$qrurl = W_DOMAIN.''.$pngname;
$this->assign('qrcode',$qrurl);
$this->display();
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2015-07-25
展开全部
$pngname = $openid.'.png';
if(imagepng($QR, $pngname)){
imagedestroy($QR);
$qrurl = W_DOMAIN.''.$pngname;
$this->assign('qrcode',$qrurl);
$this->display();
}
if(imagepng($QR, $pngname)){
imagedestroy($QR);
$qrurl = W_DOMAIN.''.$pngname;
$this->assign('qrcode',$qrurl);
$this->display();
}
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
$pngname = $openid.'.png';
if(imagepng($QR, $pngname)){
imagedestroy($QR);
$qrurl = W_DOMAIN.''.$pngname;
$this->assign('qrcode',$qrurl);
$this->display();
}
if(imagepng($QR, $pngname)){
imagedestroy($QR);
$qrurl = W_DOMAIN.''.$pngname;
$this->assign('qrcode',$qrurl);
$this->display();
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询