zoukankan      html  css  js  c++  java
  • 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&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:ChuckLuGitGitHubOther poimainHSSFUserModelHSSFCell.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:ChuckLuGitGitHubOther poiooxmlXSSFUserModelXSSFCell.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;
                }
            }
     
  • 相关阅读:
    linux中你会新建复制移动删除文件或目录吗?三分钟搞懂【文件管理】
    从此英语渣渣也能看懂man手册-【linux man手册汉化安装使用教程】
    你真的会用ls命令吗?--文件管理命令(ls命令详解)
    Python算法系列—深度优先遍历算法【二叉树】
    Python算法系列-单词匹配模式【hash练习】
    abp 从4.3升级到5.4 从入门到放弃
    ABP core2.2错误笔记2,持续更新
    echart报错: Component series.XXX not exists. Load it first
    单例模式MQTT服务为什么会重复收到消息
    在ABP core中使用RabbitMq
  • 原文地址:https://www.cnblogs.com/chucklu/p/7080799.html
Copyright © 2011-2022 走看看