根据excellent 自动生成table ,通过输入开始坐标和结束坐标

自动生成excell的 position

使用场景

使用页面生成,excell大量单元格,成千上百的量。如果量小就没必要使用。
要做Excell的table,而且要显示值,通过给td标签,添加一个postion(值是excell单元格位置)属性	来实现对大量table的赋值。具体代码地址
https://github.com/Notelzg/javaReview/tree/master/work/blog/excel-tools

code

parse 来自一个第三方的工程,下载地址是


import cn.com.goldwind.kit.excel.parser.ExcelFormulaToken;
import cn.com.goldwind.kit.excel.parser.ExcelFormulaTokenSubtype;
import cn.com.goldwind.kit.excel.parser.ExcelFormulaTokenType;
import cn.com.goldwind.kit.excel.processor.impl.ArgumentProcessor;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public void generete() throws IOException {
       BufferedWriter bwnull = new BufferedWriter(new FileWriter("c://tdPosition.txt"));
       String argument = "C58:AB59";
       String sheet = "附表5年度利润表";
       int rowLength = 27;
       ExcelFormulaToken token = new ExcelFormulaToken(argument, ExcelFormulaTokenType.Argument, ExcelFormulaTokenSubtype.Range );
       token.setSheetName(sheet);
       ArgumentProcessor te = new ArgumentProcessor();
       String[] cells = te.process(token).split(",");
       for (int i=0;cells!=null && i < cells.length; i++){
           if ((i) % rowLength == 0) {
               System.out.println("<tr>");
               bwnull.write("<tr>");
               bwnull.newLine();
           }
           System.out.println("<td position=" + cells[i] + "></td>");
           bwnull.write("<td position=" + cells[i] + "></td>");
           bwnull.newLine();
           if ((i+1) % rowLength == 0) {
               System.out.println("</tr>");
               bwnull.write("</tr");
               bwnull.newLine();
           }
       }
       bwnull.flush();
       bwnull.close();
   }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值