皕杰技术社区

 找回密码
 立即加入

扫一扫,访问微社区

QQ登录

只需一步,快速开始

查看: 22|回复: 1

实现IExportEventListener如何获取HttpServletRequest

[复制链接]
发表于 2024-4-12 12:06:18 | 显示全部楼层 |阅读模式
public class ReportExportListener implements IExportEventListener{

        @Override
        public void onExportExcel(ReportMark arg0, Workbook arg1) {
               
                System.out.println("=============="+arg0.getRpt());
                System.out.println(arg1.getSheetAt(0).getRow(0).getCell(0).getStringCellValue());
        }

}
如何在该方法中获取HttpServletRequest

发表于 2024-4-12 12:23:14 | 显示全部楼层
在API文档中有个bios.report.api.utils包下的UserContext类,可以获取HttpServletRequest
例如:
HttpServletRequest req = UserContext.getCurrentUserContext().getRequest();
具体参见API示例项目(bios.report.dev.examples)用法中相关示例
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即加入

本版积分规则

QQ|小黑屋|手机版|皕杰软件 ( 京ICP备14050931号 )

GMT+8, 2024-5-2 21:52 , Processed in 1.103333 second(s), 16 queries .

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表