Apache的POI - XSSF读取格式的单元格的值 [英] apache poi - XSSF read formatted cell value

查看:1933
本文介绍了Apache的POI - XSSF读取格式的单元格的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法,我可以得到的格式化的值,在一排擅长表演,与原始值我收到来自流回来了?

Is there any way I can get to the formatted value that excel shows in a row, versus the raw value I am getting returned from the stream?

或会在今年秋天在公式求值类别,此不支持?

Or would this fall under the "formula evaluation" category, which this does not support?

推荐答案

如果您有细胞,你试图获取数据出来,请尝试以下

If you have the Cell that you're trying to get the data out of, try the following

DataFormatter formatter = new DataFormatter();
String formattedCellValue = formatter.formatCellValue(myCell);

如果不明白你寻找什么,有一些在 DataFormatter 类不同的方法做的伎俩。查看 API

If that doesn't get exactly what you're looking for, there are a number of different methods in the DataFormatter class that do the trick. Check out the API.

这篇关于Apache的POI - XSSF读取格式的单元格的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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