且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何删除由POI生成的excel中的警告?

更新时间:2023-12-05 23:38:10

您可以尝试设置单元格类型:

  HSSFCell cell = row1.createCell(i); 
cell.setCellType(Cell.CELL_TYPE_STRING); // = 0或Cell.CELL_TYPE_NUMERIC = 1
cell.setCellValue(value);

请参阅 API文档了解更多信息。


I am using Apache POI for writing content into excel sheet. after generating an excel in all the cells which ever cell has numbers, it contains one blue mark(each cells left top corner). its like a warning. how can i remove them while writing the content to excel? PFA screen shot.

Thanks!

You can try to set the cell type:

HSSFCell cell = row1.createCell(i);
cell.setCellType(Cell.CELL_TYPE_STRING); // =0, or Cell.CELL_TYPE_NUMERIC = 1
cell.setCellValue(value);

See the API docs for more information.