ISheet ICell
/// <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;
}
}
ISheet ICell的更多相关文章
- 【DM642】ICELL Interface—Cells as Algorithm Containers
ICELL Interface—Cells as Algorithm Containers: DSP的算法标准(XDAIS)为算法提供了一个标准的接口.这样我们就可以使用第三方的算法.For tech ...
- icell更改用户管理员
管理员页面是http://127.0.0.1:8080/PORTAL/tsysLoginController/admin超级管理员是http://127.0.0.1:8080/PORTAL/tsysL ...
- 免费高效实用的.NET操作Excel组件NPOI(.NET组件介绍之六)
很多的软件项目几乎都包含着对文档的操作,前面已经介绍过两款操作文档的组件,现在介绍一款文档操作的组件NPOI. NPOI可以生成没有安装在您的服务器上的Microsoft Office套件的Excel ...
- C#通过NPOI操作Excel
参考页面: http://www.yuanjiaocheng.net/webapi/create-crud-api-1-post.html http://www.yuanjiaocheng.net/w ...
- 基于NPOI的Excel数据导入
从Excel导入数据最令人头疼的是数据格式的兼容性,特别是日期类型的兼容性.为了能够无脑导入日期,折腾了一天的NPOI.在经过测试确实可以导入任意格式的合法日期后,写下这篇小文,与大家共享.完整代码请 ...
- NPOI导出Excel
using System;using System.Collections.Generic;using System.Linq;using System.Text;#region NPOIusing ...
- ASP.NET MVC5下载数据到Excel文件
项目中的一个功能是将数据导入到Excel文件中,这里使用NPOI操作Excel,代码如下: public class Excel : IDataTransfer { public Stream Exp ...
- C# 之 EXCEL导入导出
以下方式是本人总结的一些经验,肯定有很多种方法,在此先记下,留待以后补充... 希望朋友们一起来探讨相关想法,请在下方留言. A-1:EXCEL模板导出 非常简单,将EXCEL模板上传到项目中后,将其 ...
- 如何数据库表数据导出到excel中
1.首先须要有一个NPOI 2.接下来上代码 private void button1_Click(object sender, EventArgs e) { //1.通过Ado.net读取数据 st ...
随机推荐
- 模块-- HASH
模块 HASH 一 MD5 import hashlib h = hashlib.md5() # In [237]: h # Out[237]: <md5 HASH object @ 0x0 ...
- CF451E Devu and Flowers (组合数学+容斥)
题目大意:给你$n$个箱子,每个箱子里有$a_{i}$个花,你最多取$s$个花,求所有取花的方案,$n<=20$,$s<=1e14$,$a_{i}<=1e12$ 容斥入门题目 把取花 ...
- Go语言的前景分析
本文为原创文章,转载注明出处,asdfasdfasdf 欢迎扫码关注公众号flysnow_org或者网站http://www.flysnow.org/,第一时间看后续精彩文章.觉得好的话,顺手分享到朋 ...
- thymeleaf 常用标签
1.th:field th:field="*{user.sex}" 此标签会自动填充数据,比如用户的性别 user.sex 如果不为空,则会自动勾选上 2.th:each=&qu ...
- 【codeforces 67A】Partial Teacher
[题目链接]:http://codeforces.com/problemset/problem/67/A [题意] 给一个长度为n-1的字符串; 每个字符串是'L','R','='这3种字符中的一个; ...
- LaTeX 矩阵
本系列文章由 @YhL_Leo 出品,转载请注明出处. 文章链接: http://blog.csdn.net/yhl_leo/article/details/50054363 LaTeX 写矩阵,需要 ...
- [Typescript] Installing Promise Type Definitions Using the lib Built-In Types
To fix Promise is not recolized in TypeScript, we can choose to use a lib: npm i @types/es6-promise ...
- js 压缩图片 H5
原理 用 canvas的 toDataURI (type , int ) 如果type参数的值为image/jpeg或image/webp,则第二个参数的值如果在0.0和1.0之间的话,会被看作是图 ...
- Fragment使用的正确姿势
网上关于Fragment的使用建议和分析非常多,可是依旧会有非常多人在使用Fragment的时候出现各种奇葩错误 这篇文章我分享一下各种项目中解决Fragment的各种注意事项(不做原理分析), ...
- Python: PS 图像调整--黑白
本文用Python 实现 PS 里的图像调整–黑白,PS 里的黑白并不是简单粗暴的将图像转为灰度图,而是做了非常精细的处理,具体的算法原理和效果图可以参考以前的博客: http://blog.csdn ...