ACNO1234567890234345656645656788781、这种情况下,POI在读取ACNO时,认" />
乔山办公网我们一直在努力
您的位置:乔山办公网 > excel表格制作 > java <em>poi</em>导出<em>excel</em>循环判

java <em>poi</em>导出<em>excel</em>循环判

作者:乔山办公网日期:

返回目录:excel表格制作




ACNO1234567890234345656645656788781、这种情况下,POI在读取ACNO时,认为他是数值,CUNM也一样,所以这两列应该用getNumericCellValue()读取2、在用getNumericCellValue()读取数值后,返回的值是用科学计数法表示的:doubleacno=1.23456789E9,因而必须用NumberFormat类格式化一下:format(acno)="1234567890",这才是正确的ACNO,CUNM同3、代码:NumberFormatnf=NumberFormat.getInstance();nf.setGroupingUsed(false);//true时的格式:1,234,567,890doubleacno=readCell0.getNumericCellValue();StringacnoStr=nf.format(acno);
你循环的代码有问题,把代码贴出来
---------------------------------------------------

public void createexl(String filepath){ //创建新文件
。。。。。。
。。。。。。。。
if(InFor!=null){
HSSFRow rows = null;
for(int xfinfor=0;xfinfor<InFor.size();xfinfor++ ){
int rowNum = xfinfor / 3 + 2;
int modNum = xfinfor % 3;

if(modNum == 0){
rows = sheet.createRow(rowNum);
}
String cellvalue=InFor.get(xfinfor).toString();
System.out.println(cellvalue); // 在这里能把值全部打出来。
HSSFCell setcell=rows.createCell(modNum);
setcell.setCellValue(cellvalue);//但是这里只添加最后一条?e69da5e887aa7a686964616f332
}
}
}

是用POI读取Excel表格内容么,属性循环是什么意思,需要什么操作,说的详细点

相关阅读

关键词不能为空
极力推荐

ppt怎么做_excel表格制作_office365_word文档_365办公网