Excel不同版本差异性
apache poi-3.16.jar
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */ package org.apache.poi.ss; import org.apache.poi.ss.util.CellReference; /**
* This enum allows spreadsheets from multiple Excel versions to be handled by the common code.
* <p>Properties of this enum correspond to attributes of the <i>spreadsheet</i> that are easily
* discernable to the user. It is not intended to deal with low-level issues like file formats.
*/
public enum SpreadsheetVersion {
/**
* Excel97 format aka BIFF8
* <ul>
* <li>The total number of available rows is 64k (2^16)</li>
* <li>The total number of available columns is 256 (2^8)</li>
* <li>The maximum number of arguments to a function is 30</li>
* <li>Number of conditional format conditions on a cell is 3</li>
* <li>Number of cell styles is 4000</li>
* <li>Length of text cell contents is 32767</li>
* </ul>
*/
EXCEL97(0x10000, 0x0100, 30, 3, 4000, 32767), /**
* Excel2007
*
* <ul>
* <li>The total number of available rows is 1M (2^20)</li>
* <li>The total number of available columns is 16K (2^14)</li>
* <li>The maximum number of arguments to a function is 255</li>
* <li>Number of conditional format conditions on a cell is unlimited
* (actually limited by available memory in Excel)</li>
* <li>Number of cell styles is 64000</li>
* <li>Length of text cell contents is 32767</li>
* <ul>
*/
EXCEL2007(0x100000, 0x4000, 255, Integer.MAX_VALUE, 64000, 32767); private final int _maxRows;
private final int _maxColumns;
private final int _maxFunctionArgs;
private final int _maxCondFormats;
private final int _maxCellStyles;
private final int _maxTextLength; private SpreadsheetVersion(int maxRows, int maxColumns, int maxFunctionArgs, int maxCondFormats, int maxCellStyles, int maxText) {
_maxRows = maxRows;
_maxColumns = maxColumns;
_maxFunctionArgs = maxFunctionArgs;
_maxCondFormats = maxCondFormats;
_maxCellStyles = maxCellStyles;
_maxTextLength = maxText;
} /**
* @return the maximum number of usable rows in each spreadsheet
*/
public int getMaxRows() {
return _maxRows;
} /**
* @return the last (maximum) valid row index, equals to <code> getMaxRows() - 1 </code>
*/
public int getLastRowIndex() {
return _maxRows - 1;
} /**
* @return the maximum number of usable columns in each spreadsheet
*/
public int getMaxColumns() {
return _maxColumns;
} /**
* @return the last (maximum) valid column index, equals to <code> getMaxColumns() - 1 </code>
*/
public int getLastColumnIndex() {
return _maxColumns - 1;
} /**
* @return the maximum number arguments that can be passed to a multi-arg function (e.g. COUNTIF)
*/
public int getMaxFunctionArgs() {
return _maxFunctionArgs;
} /**
* @return the maximum number of conditional format conditions on a cell
*/
public int getMaxConditionalFormats() {
return _maxCondFormats;
} /**
* @return the maximum number of cell styles per spreadsheet
*/
public int getMaxCellStyles() {
return _maxCellStyles;
} /**
*
* @return the last valid column index in a ALPHA-26 representation
* (<code>IV</code> or <code>XFD</code>).
*/
public String getLastColumnName() {
return CellReference.convertNumToColString(getLastColumnIndex());
} /**
* @return the maximum length of a text cell
*/
public int getMaxTextLength() {
return _maxTextLength;
}
}
Excel不同版本差异性的更多相关文章
- poi解析Excel文件版本问题
poi解析Excel文件时有两种格式: HSSFWorkbook格式用来解析Excel2003(xls)的文件 XSSFWorkbook格式用来解析Excel2007(xlsx)的文件 如果用HSSF ...
- Excel的版本
https://en.wikipedia.org/wiki/Microsoft_Excel 取自维基百科,需要特别注意的是,从v12开始,有很大的改变.后缀名从xls变为xlsx Versions 5 ...
- Excel 97-2003版本内部结构与查看方法
MS-XLS内部结构:BIFF格式 https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-xls/cd03cb5f-ca0 ...
- Excel导入数据(97--2003版本)的ExcelHelper
首先确定excel的版本为97~2003版本 其次创建一个帮助类——ExcelHelper //单个sheet public static DataTable AnalysisExcel(string ...
- 判断Excel版本信息
可以通过获取application对应的Version属性获取当前打开的Excel的版本信息(Application.Version).
- java 直接调用micorosoft office (2003-2007和2010版本)中excel中计算函数
主要是讲述java中poi读取excel,而excel的版本包括:2003-2007和2010两个版本, 即excel的后缀名为:xls和xlsx 读取excel和MySQL相关: java的poi技 ...
- 阿里的Easyexcel读取Excel文件(最新版本)
本篇文章主要介绍一下使用阿里开源的Easyexcel工具处理读取excel文件,因为之前自己想在网上找一下这个简单的立即上手的博客,发现很多文章的教程都针对比较旧的版本的Easyexcel,没有使 ...
- NPOI操作EXCEL(二)——大量不同模板时设计方式
上一篇文章介绍了一些NPOI的基础接口,我们现在就来看看具体怎么用NPOI来解析一个EXCEL. 博主现在有这么一堆excel需要解析数据入库: 当然这只是员工的简要模板,还有很多其他的模板.我们可以 ...
- 浅谈Excel开发:十一 针对64位Excel的插件的开发和部署
自Office 2010版本开始有了32位和64位之分,对Excel来说,32位的Excel和64位的Excel在性能上的主要区别是64位的Excel能够处理2G及2G以上的大数据集. 随着64位操作 ...
随机推荐
- 正则表达式 Regular expression为学习助跑
这是一个Regular expression的铁路图(至少我现在是这么称呼的)的图形化界面帮助检验和理解我们所写的Regular expression是否正确. 1.官网 :https://regex ...
- Django学习系列21:为每一个清单添加唯一URL
现在让我们来解决我们真正的问题,即我们的设计只允许一个全局列表. 我将演示一个关键的TDD技术:如何使用一个渐进的.循序渐进的过程来适应现有的代码,这些过程将您从工作状态转移到工作状态.测试山羊,而不 ...
- Linux配置python环境1,pyenv
安装pyenv sudo apt-get install curl git curl -L https://github.com/pyenv/pyenv-installer/raw/master/bi ...
- linux内核 同步
锁 linux本身实现了集中锁机制,各种锁机制之间的差别是,当锁已经被其他线程持有的时候,一些锁使用自旋的方式来等待,另外一些锁会当当前线程改变为睡眠状态然后等待被唤醒. 锁的争用 如果一个锁处于高度 ...
- BZOJ4777 [Usaco2017 Open]Switch Grass[最小生成树+权值线段树套平衡树]
标题解法是吓人的. 图上修改询问,不好用数据结构操作.尝试转化为树来维护.发现(不要问怎么发现的)最小生成树在这里比较行得通,因为最近异色点对一定是相邻的(很好想),所以只要看最短的一条两端连着异色点 ...
- 路由传参 -vue
参数接收 param参数 => /: => 接收参数:this.$route.params.id query参数 => ? => 接收参数:this.$route.que ...
- pd.dataframe和series以及np.narray的维度升降
1.第一步读入泰坦尼克号数据集 import pandas as pd data = pd.read_csv(r".\Narrativedata.csv" ,index_col=0 ...
- Xhorse Condor XC-Mini Plus回顾
Condor是Xhorse生产的最新型电子钥匙切割机.该机器在激光,圆柱和Tibbe键上具有出色的切割性能,几乎可以复制,切割,编码和解码任何汽车钥匙! Condor XC-MINI Plus的亮点: ...
- flex布局 justify-content:space-between; 解决最后一排数量不够自动向两端排列问题和flex布局的元素会有默认间隙(垂直间隙)
1 .flex 布局两端对齐当最后一排数量不够时,会出现以下布局情况 实现效果: 解决方案:使用after伪类, 解决最后一排数量不够两端分布的情况.宽度就是每张图片的宽度 .list:after { ...
- 浏览器表单自动填充默认样式 - autofill问题解决
这不知道是个什么神仙网站,解决办法写的这么清楚,页面有这么让人舒服 https://lhajh.github.io/css/chrome/2018/04/17/The-chrome-browser-f ...