当前位置:网站首页>jeesite导出Excel
jeesite导出Excel
2022-04-22 04:06:00 【温温top】
首先定义出需要导出字段的实体类并在导出的字段上面加入@ExcelField注解
private String orderNo;
private String userName;
private String userPhoneNo;
@ExcelField(title="用户姓名", align=2, sort=10)
public String getUserName() {
return userName;
}
@ExcelField(title="用户手机号", align=2, sort=10)
public String getUserPhoneNo() {
return userPhoneNo;
}
@ExcelField(title="订单号", align=2, sort=10)
public String getOrderNo() {
return orderNo;
}
参数说明:title 导出表头 align = 2 居中显示 sort 导出的先后顺序
实例如下
@RequestMapping(value = "privacyExport")
public String privacyExport(Order order,HttpServletResponse response,HttpServletRequest request, RedirectAttributes redirectAttributes) {
try {
String fileName = "订单列表" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
List<Order> exportList = orderDao.getOrders(order);
new ExportExcel("订单列表", Order.class).setDataList(exportList).write(response, fileName)
.dispose();
return null;
} catch (Exception e) {
e.printStackTrace();
addMessage(redirectAttributes, "导出失败!失败信息:"+e.getMessage());
}
return "redirect:"+Global.getAdminPath()+"/order/?repage";
}
版权声明
本文为[温温top]所创,转载请带上原文链接,感谢
https://blog.csdn.net/wen_3370/article/details/124312996
边栏推荐
- 交通行業提昇數據利用效率的核心是做好數據交換與共享
- 机器学习系列(5)_特征工程03碳排放小案例
- Go gin framework configuration log output to file
- 记一次云服务器配置mysql 远程连接失败的解决方案
- The United States raised interest rates and devalued the RMB, but such products ushered in a honeymoon period
- Common tool NC Wireshark rebound shell
- Pycharm jumps to the specified line
- 英特尔边缘软件中心介绍
- 均线双边对锁策略原理
- View application memory usage
猜你喜欢

Autodesk Genuine Service2020删除

Mongodb - $match operation of aggregation pipeline

染色法判定二分图

sumo 教程——高速公路

偶然间用到的sql语句

. net debugging: use visual studio to debug dump files

Exploring Presto SQL Engine (2) - Analysis of join

【网络实验】/主机/路由器/交换机/网关/路由协议/RIP+OSPF/DHCP
![[ext JS] 7.25.1 form or panel automatically locates to the wrong input box](/img/74/564b6fa9ada00aa192fb219b6bc37f.png)
[ext JS] 7.25.1 form or panel automatically locates to the wrong input box

2022-04-21: given a blacklist containing non repeating integers in [0, n), write a function to return a random integer not in the blacklist from [0, n), and optimize it to minimize the number of calls
随机推荐
win11系统开机后没有输入法——解决方法亲测有效
安装班和免安装版
Stc8a8k64d4 (51 Series MCU) printf printing data abnormal problem
[Ext JS ] 7.25.1 Form或者面板自动定位到错误的输入框
Ronglian Qimo empowers enterprises with intelligent services and redefines the value of customer service
JDBC uses precompiling to execute DQL statements, and the output is placeholder content. Why?
Go gin framework configuration log output to file
Product sharing: QT + OSG education discipline tool: Geographic 3D planet
染色法判定二分图
虚拟dom
Senet | attention mechanism - source code + comments
PowerDesiPowerDesigner导入sql 不显示表关联关系 怎么解决
Autodesk genuine service2020 delete
RF and microwave design software
On the origin of wireless operation and maintenance and project construction
Set iFLYTEK x Yunnan flying: a tiktok solution to solve the problem of converting passengers to achieve real-time response to private letter reply!
Do447ansible tower navigation
MySQL下载
专家有料 | 张祖优:腾讯云DevSecOps实践与开源治理探索
Alibaba cloud EMAS product dynamics in March