如何删除 POI 生成的 excel 中的警告? [英] how to remove warnings in excel generated by POI ?

查看:38
本文介绍了如何删除 POI 生成的 excel 中的警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Apache POI 将内容写入 Excel 表格.在所有单元格有数字的单元格中生成一个 excel 后,它包含一个蓝色标记(每个单元格左上角).它就像一个警告.如何在将内容写入 excel 时删除它们?PFA 屏幕截图.

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.

谢谢!

推荐答案

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

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);

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

See the API docs for more information.

这篇关于如何删除 POI 生成的 excel 中的警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆