/// <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&lt;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&lt;errIdx&gt;
/// </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&lt;errIdx&gt;
/// </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;
}
}

ISheet ICell的更多相关文章

  1. 【DM642】ICELL Interface—Cells as Algorithm Containers

    ICELL Interface—Cells as Algorithm Containers: DSP的算法标准(XDAIS)为算法提供了一个标准的接口.这样我们就可以使用第三方的算法.For tech ...

  2. icell更改用户管理员

    管理员页面是http://127.0.0.1:8080/PORTAL/tsysLoginController/admin超级管理员是http://127.0.0.1:8080/PORTAL/tsysL ...

  3. 免费高效实用的.NET操作Excel组件NPOI(.NET组件介绍之六)

    很多的软件项目几乎都包含着对文档的操作,前面已经介绍过两款操作文档的组件,现在介绍一款文档操作的组件NPOI. NPOI可以生成没有安装在您的服务器上的Microsoft Office套件的Excel ...

  4. C#通过NPOI操作Excel

    参考页面: http://www.yuanjiaocheng.net/webapi/create-crud-api-1-post.html http://www.yuanjiaocheng.net/w ...

  5. 基于NPOI的Excel数据导入

    从Excel导入数据最令人头疼的是数据格式的兼容性,特别是日期类型的兼容性.为了能够无脑导入日期,折腾了一天的NPOI.在经过测试确实可以导入任意格式的合法日期后,写下这篇小文,与大家共享.完整代码请 ...

  6. NPOI导出Excel

    using System;using System.Collections.Generic;using System.Linq;using System.Text;#region NPOIusing ...

  7. ASP.NET MVC5下载数据到Excel文件

    项目中的一个功能是将数据导入到Excel文件中,这里使用NPOI操作Excel,代码如下: public class Excel : IDataTransfer { public Stream Exp ...

  8. C# 之 EXCEL导入导出

    以下方式是本人总结的一些经验,肯定有很多种方法,在此先记下,留待以后补充... 希望朋友们一起来探讨相关想法,请在下方留言. A-1:EXCEL模板导出 非常简单,将EXCEL模板上传到项目中后,将其 ...

  9. 如何数据库表数据导出到excel中

    1.首先须要有一个NPOI 2.接下来上代码 private void button1_Click(object sender, EventArgs e) { //1.通过Ado.net读取数据 st ...

随机推荐

  1. (2016北京集训十)【xsy1528】azelso - 概率期望dp

    北京集训的题都是好题啊~~(于是我爆0了) 注意到一个重要的性质就是期望是线性的,也就是说每一段的期望步数可以直接加起来,那么dp求出每一段的期望就行了... 设$f_i$表示从$i$出发不回到$i$ ...

  2. 【BZOJ4444】国旗计划 - 决策单调性

    Description A国正在开展一项伟大的计划——国旗计划.这项计划的内容是边防战士手举国旗环绕边境线奔袭一圈.这项计划需要多名边防战士以接力的形式共同完成,为此,国土安全局已经挑选了N名优秀的边 ...

  3. ES6学习笔记(二十二)ArrayBuffer

    ArrayBuffer ArrayBuffer对象.TypedArray视图和DataView视图是 JavaScript 操作二进制数据的一个接口.它们都是以数组的语法处理二进制数据,所以统称为二进 ...

  4. 推荐学习《组织与管理研究的实证方法(第2版)》中文PDF

    在写文章论文时,会涉及到观点论证,需要掌握一些实证方法. 建议学习<组织与管理研究的实证方法(第2版)>,对管理研究中涉及的方法进行了介绍,例如实验室研究,二手数据的研究,实地研究等,这对 ...

  5. Rancher介绍安装以及对docker的管理

    原文:Rancher介绍安装以及对docker的管理 一.简介 Rancher是一个开源的企业级全栈化容器部署及管理平台.Rancher为容器提供一揽子基础架构服务:CNI兼容的网络服务.存储服务.主 ...

  6. deeplink技术的两篇资料

    两篇资料如下: https://zhuanlan.zhihu.com/p/20694818?refer=ouyangchen http://www.sohu.com/a/122694049_49134 ...

  7. datatable 前台和后台数据格式

    datatable是很强大的前台表格插件,前台定义好表格格式后,后台须要返回指定格式的json数据! 例如以下: 首先是js的定义: var oTable = $('#sample_editable_ ...

  8. hibernate ID生成策略配置

    1.Student.hbm.xml配置 <hibernate-mapping package="com.wxh.hibernate.model"> <class ...

  9. poj--1904--King's Quest(scc建图)

    King's Quest Time Limit: 15000MS   Memory Limit: 65536KB   64bit IO Format: %I64d & %I64u Submit ...

  10. directshow 获取本地摄像头播放

    最近因为项目的需要,做了一个基本的获取本地笔记本摄像头并且播放的例子,因为网上的关于这部分的完整例子基本都没有,那我就上传一个吧,希望能够帮到需要学习视频的朋友. 另外也是为了纪念雷霄骅博士为音视频方 ...