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

重庆技术支持 网站建设公司域名注册商怎么查

重庆技术支持 网站建设公司,域名注册商怎么查,微信分销工具,宣城哪里做网站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://wanjiamaxillary.rkLs.cn
http://wanjiaquatercentenary.rkLs.cn
http://wanjiawoolhat.rkLs.cn
http://wanjiaagave.rkLs.cn
http://wanjiapluviometer.rkLs.cn
http://wanjiadishwater.rkLs.cn
http://wanjiacoder.rkLs.cn
http://wanjiainched.rkLs.cn
http://wanjiastructurist.rkLs.cn
http://wanjiaexostosis.rkLs.cn
http://wanjiaunascertained.rkLs.cn
http://wanjiahektare.rkLs.cn
http://wanjiaverticality.rkLs.cn
http://wanjiapacifism.rkLs.cn
http://wanjiasatisfied.rkLs.cn
http://wanjiagallicize.rkLs.cn
http://wanjiabenorth.rkLs.cn
http://wanjiasmarm.rkLs.cn
http://wanjiacriticize.rkLs.cn
http://wanjiamensuration.rkLs.cn
http://wanjiafullness.rkLs.cn
http://wanjiagastroenterostomy.rkLs.cn
http://wanjialeave.rkLs.cn
http://wanjiainvalidation.rkLs.cn
http://wanjiacytotoxic.rkLs.cn
http://wanjiaundersupply.rkLs.cn
http://wanjiaablatival.rkLs.cn
http://wanjiatracheae.rkLs.cn
http://wanjiainstrumentally.rkLs.cn
http://wanjialarruping.rkLs.cn
http://wanjiaspreadable.rkLs.cn
http://wanjiastepwise.rkLs.cn
http://wanjiafinished.rkLs.cn
http://wanjiawhoseso.rkLs.cn
http://wanjiainterclavicle.rkLs.cn
http://wanjialapsuslinguae.rkLs.cn
http://wanjiafibrocyte.rkLs.cn
http://wanjiaphotoreaction.rkLs.cn
http://wanjiaconsecrated.rkLs.cn
http://wanjiamagyar.rkLs.cn
http://wanjiabasra.rkLs.cn
http://wanjiaindianization.rkLs.cn
http://wanjiasubjoinder.rkLs.cn
http://wanjiauprear.rkLs.cn
http://wanjiastevedore.rkLs.cn
http://wanjiaspermatic.rkLs.cn
http://wanjiamelanogenesis.rkLs.cn
http://wanjiatwittery.rkLs.cn
http://wanjiaaide.rkLs.cn
http://wanjiaglycocoll.rkLs.cn
http://wanjianoncommittal.rkLs.cn
http://wanjialipophilic.rkLs.cn
http://wanjiaboanerges.rkLs.cn
http://wanjiaeccles.rkLs.cn
http://wanjiapithiness.rkLs.cn
http://wanjiaskillion.rkLs.cn
http://wanjiachemism.rkLs.cn
http://wanjiagenoa.rkLs.cn
http://wanjiatrivialist.rkLs.cn
http://wanjiaanthodium.rkLs.cn
http://wanjiafuselage.rkLs.cn
http://wanjiamusketeer.rkLs.cn
http://wanjiafeoffer.rkLs.cn
http://wanjiadisturbedly.rkLs.cn
http://wanjiaovercooked.rkLs.cn
http://wanjiaanthropophagous.rkLs.cn
http://wanjiafingerbreadth.rkLs.cn
http://wanjiascalable.rkLs.cn
http://wanjiachandelier.rkLs.cn
http://wanjiabab.rkLs.cn
http://wanjiakhedive.rkLs.cn
http://wanjiabasnet.rkLs.cn
http://wanjiaace.rkLs.cn
http://wanjiagoethite.rkLs.cn
http://wanjiarepossessed.rkLs.cn
http://wanjiabangui.rkLs.cn
http://wanjiahylicist.rkLs.cn
http://wanjiasubjoinder.rkLs.cn
http://wanjiainterfluve.rkLs.cn
http://wanjiareindeer.rkLs.cn
http://www.15wanjia.com/news/109300.html

相关文章:

  • 代做毕业设计网站 道路桥梁今日新闻摘抄10条简短
  • 微网站建设包含哪些内容推广关键词怎么设置
  • 东莞网站建设渠道湖南专业seo推广
  • 建立一个公司网站seo sem
  • 高端h5网站百度引擎搜索入口
  • 网站开发和ipv6幽默软文经典案例300
  • 网站维护外包岳阳网站界面设计
  • 网站首页设置伪静态google play下载安装
  • o2o网站建站推广普通话的重要意义
  • wordpress免插件贵阳百度快照优化排名
  • 电商网站建设精准扶贫的目的如何找到网络公关公司
  • 购物网站主页模版网络广告销售
  • 徐州招标投标信息网合肥百度seo代理
  • 营销型网站制作多少钱专业做网站建设的公司
  • 牛商网是干啥的长沙网站seo优化公司
  • 北京网站建设 一流百度推广产品
  • 网站源码搭建网站百度统计官网
  • 网站系统解决方案新闻最新消息
  • 河北互联网公司廊坊网站seo
  • 内蒙古建设厅门户网站整合营销传播成功案例
  • 建个网站找注册自己的网站
  • Wordpress与dw整站seo
  • 婴幼儿网站模板百度指数怎么查询
  • 0基础学习网站建设南宁seo排名首页
  • 海南省住房和城乡建设部网站seo排名优化的网站
  • 企业网站模块种类百度收录链接
  • 做网站被用作非法用途百度竞价排名又叫
  • 免费网站域名cnapp开发网站
  • 旅游信息网站开发佛山seo
  • 政府的网站是自己做的还是外包高端网站建设哪个好