ISheet ICell
2024-08-28 05:58:25
/// <summary>
/// Gets the first row on the sheet
/// </summary>
/// <value>the number of the first logical row on the sheet (0-based).</value>
int FirstRowNum { get; } /// <summary>
/// Gets the last row on the sheet
/// </summary>
/// <value>last row contained n this sheet (0-based)</value>
int LastRowNum { get; }
/// <summary>
/// Get the number of the first cell Contained in this row.
/// </summary>
/// <returns>
/// short representing the first logical cell in the row,
/// or -1 if the row does not contain any cells.
/// </returns>
short FirstCellNum { get; } /// <summary>
/// Gets the index of the last cell Contained in this row <b>PLUS ONE</b>. The result also
/// happens to be the 1-based column number of the last cell. This value can be used as a
/// standard upper bound when iterating over cells:
/// <pre>
/// short minColIx = row.GetFirstCellNum();
/// short maxColIx = row.GetLastCellNum();
/// for(short colIx=minColIx; colIx<maxColIx; colIx++) {
/// Cell cell = row.GetCell(colIx);
/// if(cell == null) {
/// continue;
/// }
/// //... do something with cell
/// }
/// </pre>
/// </summary>
/// <returns>
/// short representing the last logical cell in the row <b>PLUS ONE</b>,
/// or -1 if the row does not contain any cells.
/// </returns>
short LastCellNum { get; }
Excel2003
HSSFWorkbook
D:\ChuckLu\Git\GitHub\Other\npoi\main\HSSF\UserModel\HSSFCell.cs
/// <summary>
/// Returns a string representation of the cell
/// This method returns a simple representation,
/// anthing more complex should be in user code, with
/// knowledge of the semantics of the sheet being Processed.
/// Formula cells return the formula string,
/// rather than the formula result.
/// Dates are Displayed in dd-MMM-yyyy format
/// Errors are Displayed as #ERR<errIdx>
/// </summary>
public override String ToString()
{
switch (CellType)
{
case CellType.Blank:
return "";
case CellType.Boolean:
return BooleanCellValue ? "TRUE" : "FALSE";
case CellType.Error:
return NPOI.SS.Formula.Eval.ErrorEval.GetText(((BoolErrRecord)_record).ErrorValue);
case CellType.Formula:
return CellFormula;
case CellType.Numeric:
string format = this.CellStyle.GetDataFormatString();
DataFormatter formatter = new DataFormatter();
return formatter.FormatCellValue(this);
case CellType.String:
return StringCellValue;
default:
return "Unknown Cell Type: " + CellType;
} }
Excel2007
XSSFWorkbook
D:\ChuckLu\Git\GitHub\Other\npoi\ooxml\XSSF\UserModel\XSSFCell.cs
/// <summary>
/// Returns a string representation of the cell
/// </summary>
/// <returns>Formula cells return the formula string, rather than the formula result.
/// Dates are displayed in dd-MMM-yyyy format
/// Errors are displayed as #ERR<errIdx>
/// </returns>
public override String ToString()
{
switch (CellType)
{
case CellType.Blank:
return "";
case CellType.Boolean:
return BooleanCellValue ? "TRUE" : "FALSE";
case CellType.Error:
return ErrorEval.GetText(ErrorCellValue);
case CellType.Formula:
return CellFormula;
case CellType.Numeric:
if (DateUtil.IsCellDateFormatted(this))
{
FormatBase sdf = new SimpleDateFormat("dd-MMM-yyyy");
return sdf.Format(DateCellValue, CultureInfo.CurrentCulture);
}
return NumericCellValue.ToString();
case CellType.String:
return RichStringCellValue.ToString();
default:
return "Unknown Cell Type: " + CellType;
}
}
最新文章
- 堆排序C++实现
- 为 Exchange 服务器编写自定义的反垃圾插件
- C#7.0中有新特性
- .net core 1.0 Web MVC 自定义认证过程
- SQL DMO のDMV
- JDK1.7 安装加(一劳永逸的环境配置)
- ArcGIS API for JavaScript 4.2学习笔记[23] 没有地图如何进行查询?【FindTask类的使用】
- linux下各种解压方法
- ArrayList与LinkList
- ubuntu16.04 离线安装docker ce
- linux添加定时任务crond
- C++进阶--构造函数和析构函数中的虚函数
- 牛客网Wannafly挑战赛15 B车辆安排(模拟)AND C 出队(规律)
- 在Asp.Net中使用jQueryEasyUI(转)
- Java DecimalFormat的主要功能及使用方法
- NBUT 1220 SPY 2010辽宁省赛
- Entityframework:启用延时加载的主意事项(只为强化记忆)
- 洛谷 P3102 [USACO14FEB]秘密代码Secret Code 【区间dp】
- 百度NLP二面
- Redis--初入
热门文章
- NodeJS学习笔记 (8)网络服务-http-server(ok)
- &#39;Upgrade&#39; header is missing
- 在WIN7、WIN10操作系统用WebDAV映射网络驱动器需要的操作
- php通过shell调用Hadoop的方法
- C++ 何时使用动态分配(即使用newkeyword)?何时使用指针?
- nj11--http
- java9新特性-6-多版本兼容jar包
- 机器学习规则:ML工程最佳实践----rule_of_ml section 3【翻译】
- mac终端(terminal)里的快捷键
- MyEclipse for mac 快捷键