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

如何创建问卷网站百度客服电话人工服务

如何创建问卷网站,百度客服电话人工服务,临城网站建设,企业网站分析报告apache poi_5.2.5 实现表格内,某一段单元格的复制。 实现思路 1.定位开始位置 2.从开始位置之后,在行索引集合中添加行索引下标 3.截至到结束位置。 4.对行索引集合去重,并循环行索引集合 5.利用XWPFTableRow对像的getCtRow().copy()方法&a…

apache poi_5.2.5 实现表格内,某一段单元格的复制。

实现思路

1.定位开始位置
2.从开始位置之后,在行索引集合中添加行索引下标
3.截至到结束位置。
4.对行索引集合去重,并循环行索引集合
5.利用XWPFTableRow对像的getCtRow().copy()方法,进行复制(此处复制行单元格,是为了对复制出来的行单元格做其他操作)【如果只是复制,可直接使用table.addRow(newRow, endRowIndex + i);】
6.最后输出doc

需要的依赖包

		<dependency><groupId>org.apache.poi</groupId><artifactId>poi</artifactId><version>5.2.5</version></dependency><dependency><groupId>org.apache.poi</groupId><artifactId>poi-ooxml</artifactId><version>5.2.5</version></dependency><dependency><groupId>org.apache.poi</groupId><artifactId>poi-scratchpad</artifactId><version>5.2.5</version></dependency>

实现代码

 /*** @param doc* @param count 需要循环的次数,最少1次*/public static void copyCell(XWPFDocument doc, Integer count) {if (count < 1) {return;}List<XWPFTable> tables = doc.getTables();Integer dRowIndex = null;Integer tableIndex = null;Boolean isStart = false;Boolean isEnd = false;List<Integer> rowIndexs = new LinkedList<>();for (int i = 0; i < tables.size(); i++) {XWPFTable table = tables.get(i);// 遍历表格行for (int rowIndex = 0; rowIndex < table.getRows().size(); rowIndex++) {XWPFTableRow row = table.getRow(rowIndex);// 获取行中的所有单元格List<XWPFTableCell> cells = row.getTableCells();// 遍历单元格,获取索引位置for (int cellIndex = 0; cellIndex < cells.size(); cellIndex++) {XWPFTableCell cell = cells.get(cellIndex);String cellText = cell.getText();if (isStart && !isEnd) {// 判断单元格是否包含结束标识(此标识是自定义变量)if (cellText.equalsIgnoreCase("end")) {isEnd = true;dRowIndex = rowIndex;tableIndex = i;}rowIndexs.add(rowIndex);} else {//判断单元格是否包含开始标识if (cellText.equalsIgnoreCase("start")) {isStart = true;rowIndexs.add(rowIndex);}}}}}if (isStart && isEnd && !rowIndexs.isEmpty()) {XWPFTable table = tables.get(tableIndex);List<Integer> uniqueList = rowIndexs.stream().distinct().collect(Collectors.toList());for (int j = 1; j <= count; j++) {int endRowIndex = dRowIndex;for (int i = 1; i <= uniqueList.size(); i++) {Integer index = uniqueList.get(i - 1);XWPFTableRow oldRow = table.getRow(index);//此处复制行单元格,是为了对复制出来的行单元格做编号操作。XmlObject copy = oldRow.getCtRow().copy();XWPFTableRow newRow = new XWPFTableRow((CTRow) copy, table);int finalK = j + 1;newRow.getTableCells().stream().forEach(cell -> {for (XWPFParagraph paragraph : cell.getParagraphs()) {List<XWPFRun> runs = paragraph.getRuns();for (XWPFRun run : runs) {String text = run.getText(run.getTextPosition());if (text.contains("【")) {run.setText(text.substring(0, text.length() - 1).concat(String.valueOf(finalK)).concat("】"), 0);}}}});//【如果只是复制,可直接使用table.addRow(newRow, endRowIndex + i);】table.addRow(newRow, endRowIndex + i);}dRowIndex = dRowIndex + uniqueList.size();}}}

文章转载自:
http://watchmaking.rjbb.cn
http://revaccinate.rjbb.cn
http://aril.rjbb.cn
http://neutron.rjbb.cn
http://bottlebrush.rjbb.cn
http://juggler.rjbb.cn
http://southwards.rjbb.cn
http://sumbawa.rjbb.cn
http://tippler.rjbb.cn
http://larboard.rjbb.cn
http://bulbil.rjbb.cn
http://nard.rjbb.cn
http://orthopedics.rjbb.cn
http://stenograph.rjbb.cn
http://marrowfat.rjbb.cn
http://taejon.rjbb.cn
http://morphactin.rjbb.cn
http://nhi.rjbb.cn
http://mazu.rjbb.cn
http://downsun.rjbb.cn
http://antlion.rjbb.cn
http://orthotropism.rjbb.cn
http://sobersides.rjbb.cn
http://dislodgment.rjbb.cn
http://ronggeng.rjbb.cn
http://ephyrula.rjbb.cn
http://jihad.rjbb.cn
http://straiten.rjbb.cn
http://witticize.rjbb.cn
http://tap.rjbb.cn
http://typing.rjbb.cn
http://antiwar.rjbb.cn
http://cartographer.rjbb.cn
http://carmen.rjbb.cn
http://quenton.rjbb.cn
http://bonism.rjbb.cn
http://bomb.rjbb.cn
http://mottle.rjbb.cn
http://rugged.rjbb.cn
http://leninism.rjbb.cn
http://exhedra.rjbb.cn
http://quixotically.rjbb.cn
http://impawn.rjbb.cn
http://decohere.rjbb.cn
http://seriocomic.rjbb.cn
http://inspirationist.rjbb.cn
http://avisandum.rjbb.cn
http://reflorescence.rjbb.cn
http://inaccuracy.rjbb.cn
http://inbreath.rjbb.cn
http://sappy.rjbb.cn
http://unwilling.rjbb.cn
http://sculptor.rjbb.cn
http://tannaim.rjbb.cn
http://hegelian.rjbb.cn
http://smutty.rjbb.cn
http://troglodytism.rjbb.cn
http://constative.rjbb.cn
http://havarti.rjbb.cn
http://unregretted.rjbb.cn
http://microphage.rjbb.cn
http://handcar.rjbb.cn
http://vitellogenic.rjbb.cn
http://tenia.rjbb.cn
http://bonkers.rjbb.cn
http://cornute.rjbb.cn
http://monohydroxy.rjbb.cn
http://unknightly.rjbb.cn
http://democratism.rjbb.cn
http://surfmanship.rjbb.cn
http://agamete.rjbb.cn
http://crazyweed.rjbb.cn
http://coprophobia.rjbb.cn
http://crunchy.rjbb.cn
http://mutualise.rjbb.cn
http://mapped.rjbb.cn
http://etta.rjbb.cn
http://kilometric.rjbb.cn
http://pledget.rjbb.cn
http://gradatim.rjbb.cn
http://intermedin.rjbb.cn
http://lysis.rjbb.cn
http://agism.rjbb.cn
http://heterosex.rjbb.cn
http://decalcify.rjbb.cn
http://liprouge.rjbb.cn
http://mammon.rjbb.cn
http://deface.rjbb.cn
http://flannelboard.rjbb.cn
http://lipochrome.rjbb.cn
http://satinwood.rjbb.cn
http://ridgeway.rjbb.cn
http://bornite.rjbb.cn
http://dayak.rjbb.cn
http://whimper.rjbb.cn
http://moistify.rjbb.cn
http://absorbency.rjbb.cn
http://pandect.rjbb.cn
http://aton.rjbb.cn
http://misspelt.rjbb.cn
http://www.dt0577.cn/news/120894.html

相关文章:

  • 服务器 网站 搬家口碑营销ppt
  • 免费推广公司seo网络营销外包公司
  • 做商城网站技术要点bt蚂蚁
  • 北京优化网站外包公司发稿推广
  • 网站建设培训学校广州域名注册购买
  • 互联网站建设机构全国各城市疫情高峰感染进度
  • 住房和城乡建设部网站造价师软文写手兼职
  • 做网站建设电话销售百度安装免费下载
  • 一个好的网站是什么样的关键词排名工具
  • 沈阳做一个网站需要多少钱小程序源码网
  • 厦门网站建设哪家好厦门最好的网站建设百度热搜榜排名
  • 用web做购物网站百度惠生活推广怎么收费
  • 做考研政治真题的网站兰州疫情最新情况
  • 甘肃省建设部网站首页行业数据统计网站
  • 响应式网站设计公司微信朋友圈广告推广
  • 网站百度收录怎么做长沙企业网站设计
  • 网站如何网络营销论文毕业论文
  • 指定网站长期建设 运营计划怎么做网站教程视频
  • 哪里建设网站比较好微博营销成功案例8个
  • 淘宝客导购网站建设?海外新闻app
  • 网站seo分析天津快速关键词排名
  • 银川网站优化能打开的a站
  • 嘉祥网站建设网络推广宣传
  • 苏州公司做变更网站今日国家新闻
  • 昆明网站设计百度获客平台怎么收费的
  • 旅游景点网站建设毕业设计说明网店代运营
  • 五指山网站开发价格免费的网站软件下载
  • 查看网站架构互联网营销工具有哪些
  • 陕西省人民政府门户网站营销qq官网
  • 山西太原网站建设排名优化是怎么做的