用jfinal-ext导出excel下载
@绝望的八皮 你好,想跟你请教个问题:我页面发送ajax请求到后台执行导出excel操作,直接将model的一个集合传进去。代码都执行完了,也没有异常,前端怎么都没有反应呢?代码如下:
public void toExcel(){
List<Record> data = Db.find("select * from xinshang.signup order by id desc");
String[] columns = {"ID","ADD_DATE","CLASSES","DISPOSE_LOG","CLIENT","RECYCLE_DEL","COURSES","NAME","JOB","PHONE","FAX","EMAIL","QQ","NUMBER_PEOPLE","COMPANY"
,"ADDRESS","AGE","SEX","WEIXIN","PERIOD","REMARKS","REFERER","VALID"};
String[] heades = {"ID","ADD_DATE","CLASSES","DISPOSE_LOG","CLIENT","RECYCLE_DEL","COURSES","NAME","JOB","PHONE","FAX","EMAIL","QQ","NUMBER_PEOPLE","COMPANY"
,"ADDRESS","AGE","SEX","WEIXIN","PERIOD","REMARKS","REFERER","VALID"};
try {
PoiRender excel = new PoiRender(data);
render(excel.sheetName("所有").headers(heades).columns(columns).fileName("test.xls"));
} catch (Exception e) {
e.printStackTrace();
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
up
还真是这个问题。。。换用表单提交的方式就没有问题了,多谢!
感觉ajax行不通,你不用ajax方式。