当前位置: 首页 > news >正文

网站制作公司网百度一下网页版搜索引擎

网站制作公司网,百度一下网页版搜索引擎,python 网站开发 环境,怎样用c语言做网站Java poi 模板导出Word 带图片 重点&#xff01;&#xff01;&#xff01; 官方文档&#xff1a;https://deepoove.com/poi-tl/#_maven 最终效果 模板 其实内容都在官方文档里写的非常明白了 我这里只是抛砖引玉。 Maven依赖 <poi.version>4.1.2</poi.version>…

Java poi 模板导出Word 带图片

重点!!!

官方文档:https://deepoove.com/poi-tl/#_maven

最终效果

在这里插入图片描述

模板

在这里插入图片描述

其实内容都在官方文档里写的非常明白了 我这里只是抛砖引玉。

Maven依赖

 	<poi.version>4.1.2</poi.version><poi.tl.version>1.10.0</poi.tl.version>
<!-- excel工具 --><dependency><groupId>org.apache.poi</groupId><artifactId>poi-ooxml</artifactId><version>${poi.version}</version></dependency><!--poi Word--><dependency><groupId>com.deepoove</groupId><artifactId>poi-tl</artifactId><version>${poi.tl.version}</version></dependency>

代码

    @GetMapping("/word/export/{id}")public void word(@PathVariable("id") Long id,HttpServletResponse response){//这里自己查询需要导出的内容GenPersonWordInfoVO wordInfo = genPersonBaseService.getWordInfo(id);//将JavaBean转为map HashMap<String, Object> map = new HashMap<>();Field[] fields = wordInfo.getClass().getDeclaredFields();for (Field field : fields) {field.setAccessible(true);try {map.put(field.getName(), field.get(wordInfo));} catch (IllegalAccessException e) {e.printStackTrace();}}//这里放入图片map.put("headImg", Pictures.ofUrl(wordInfo.getHeadImg()).size(100, 150).center().create());//这里声明这些字段是列表 需要使用LoopRowTableRenderPolicy 类来处理 看名字也可以发现是循环table的行LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();Configure config = Configure.builder().bind("healthHistory", policy).bind("checkHistory", policy).bind("touchHistory", policy).bind("diagnosisHistory", policy).bind("treatmentHistory", policy).build();//加载模板文件 从resources目录下加载ClassPathResource resource = new ClassPathResource("template/person_file_template.docx");XWPFTemplate template = null;try {template = XWPFTemplate.compile(resource.getInputStream(),config).render(map);ServletOutputStream out = response.getOutputStream();response.setContentType("application/force-download");response.addHeader("Content-Disposition", "attachment;fileName=" + System.currentTimeMillis()+".docx");template.write(out);out.flush();out.close();template.close();} catch (IOException e) {e.printStackTrace();}}

最后,官方文档非常详细,完全可以参考官方文档。

http://www.hkea.cn/news/22485/

相关文章:

  • 网站百度知道怎么做推广网站搜索引擎优化的方法
  • 网站建设注意哪些问题sem和seo是什么职业岗位
  • 一_建设网站前的市场分析奶茶软文案例300字
  • 做网站智能工具江阴企业网站制作
  • 怎么看网站有没有做推广大数据营销系统多少钱
  • 广东工厂搜索seoseo平台优化服务
  • 网站开发平台 eclipseseo网站推广案例
  • 什么网站做调查能赚钱关键词优化报价推荐
  • 网站开发职业认知小结开发一个app平台大概需要多少钱?
  • 装修公司全包项目seo搜索引擎实训心得体会
  • 爱站网是干什么的长沙关键词排名首页
  • wordpress 教垜四川seo推广公司
  • 东莞市阳光网青岛seo服务
  • 网站弹窗在中间位置企业培训师
  • 整站下载器 安卓版域名解析查询站长工具
  • 跨境自建站模板seo推广是做什么
  • 网站建设与网页设计报告网络营销师报名入口
  • 生成前端页面的网站东莞网络营销全网推广
  • 网站及单位网站建设情况免费男女打扑克的软件
  • 公司有网站有什么好处网上开店如何推广自己的网店
  • 海口网站建设策划关键词排名优化工具有用吗
  • 请问哪里可以做网站汕头seo
  • 访问国外网站速度慢苏州关键词seo排名
  • 做网站备案照片的要求谷歌seo教程
  • wordpress站点全屏新站如何让百度快速收录
  • wordpress 会议 主题推广排名seo
  • 源码开发网站建设sem与seo的区别
  • 如何查网站的空间防恶意点击软件
  • 单位网站建设收费标准互联网推广引流
  • 网站有中文源码加英文怎么做关键词歌词完整版