weixin2319 2018-04-15 12:27 采纳率: 0%
浏览 838
已结题

用java和poi实现Excel的读写操作,急求!

sheet已经获取到
在如下两个方法中实现读取黄色部分的值然后写入到另一个模板的同样位置图片说明
//获取DVP里的数据
public static boolean bompass(XSSFSheet sheet) {
boolean is_ok=true;
//List result=new ArrayList();
XLSWriter xl=new XLSWriter();
for (int rownum = 0; rownum < sheet.getLastRowNum(); rownum++) {
XSSFRow row = sheet.getRow(2);
String ss = row.toString();
System.out.println(ss);
if (row!=null) {
XSSFCell cell = row.getCell(1);
String cc = xl.getStringCellValue(cell);
System.out.println(cc);
/*String DVR_NO = sheet.getCellComment(4, 1).toString();
System.out.println(DVR_NO);

            String PARTS_NAME=sheet.getCellComment(5, 2).toString();
            System.out.println(PARTS_NAME);

            String PARTS_FIGURE_NO=sheet.getCellComment(5, 4).toString();
            System.out.println(PARTS_FIGURE_NO);*/

            String[] readline = xl.readline(rownum, 1, 4);
            System.out.println(readline);

            /*String stringCellValue = xl.getStringCellValue(cell);
            //String stringCellValue = row.getCell(2).getStringCellValue();
            System.out.println(stringCellValue);
            result.add(stringCellValue);*/
        }
    }
    return is_ok;
}

//将数据写入到com/jmh/core/excel/DVR.xls中
public static void resetBOMSequence(XSSFWorkbook wb) {

}
  • 写回答

1条回答

  • threenewbee 2018-04-15 15:41
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?