using System; using System.Collections.Generic; using System.Text; using HH.WMS.Utils.NPOI.SS.Util; namespace HH.WMS.Utils.NPOI.SS { /** * This enum allows spReadsheets from multiple Excel versions to be handled by the common code. * Properties of this enum correspond to attributes of the spReadsheet that are easily * discernable to the user. It is not intended to deal with low-level issues like file formats. *

* * @author Josh Micich * @author Yegor Kozlov */ public class SpreadsheetVersion { /** * Excel97 format aka BIFF8 *

*/ public static SpreadsheetVersion EXCEL97 = new SpreadsheetVersion(0x10000, 0x0100, 30, 3, 32767); /** * Excel2007 * * */ public static SpreadsheetVersion EXCEL2007 = new SpreadsheetVersion(0x100000, 0x4000, 255, Int32.MaxValue, Int32.MaxValue); private int _maxRows; private int _maxColumns; private int _maxFunctionArgs; private int _maxCondFormats; private int _maxTextLength; private SpreadsheetVersion(int maxRows, int maxColumns, int maxFunctionArgs, int maxCondFormats, int maxText) { _maxRows = maxRows; _maxColumns = maxColumns; _maxFunctionArgs = maxFunctionArgs; _maxCondFormats = maxCondFormats; _maxTextLength = maxText; } /** * @return the maximum number of usable rows in each spReadsheet */ public int MaxRows { get { return _maxRows; } } /** * @return the last (maximum) valid row index, equals to GetMaxRows() - 1 */ public int LastRowIndex { get { return _maxRows - 1; } } /** * @return the maximum number of usable columns in each spReadsheet */ public int MaxColumns { get { return _maxColumns; } } /** * @return the last (maximum) valid column index, equals to GetMaxColumns() - 1 */ public int LastColumnIndex { get { return _maxColumns - 1; } } /** * @return the maximum number arguments that can be passed to a multi-arg function (e.g. COUNTIF) */ public int MaxFunctionArgs { get { return _maxFunctionArgs; } } /** * * @return the maximum number of conditional format conditions on a cell */ public int MaxConditionalFormats { get { return _maxCondFormats; } } /** * * @return the last valid column index in a ALPHA-26 representation * (IV or XFD). */ public String LastColumnName { get { return CellReference.ConvertNumToColString(LastColumnIndex); } } /** * @return the maximum length of a text cell */ public int MaxTextLength { get { return _maxTextLength; } } } }