<?xml version="1.0"?>
<doc>
<assembly>
<name>NPOI</name>
</assembly>
<members>
<member name="T:NPOI.DDF.AbstractEscherOptRecord">
Common abstract class for {@link EscherOptRecord} and
{@link EscherTertiaryOptRecord}
@author Sergey Vladimirov (vlsergey {at} gmail {dot} com)
@author Glen Stampoultzis
</member>
<member name="T:NPOI.DDF.EscherRecord">
<summary>
The base abstract record from which all escher records are defined. Subclasses will need
to define methods for serialization/deserialization and for determining the record size.
@author Glen Stampoultzis
</summary>
</member>
<member name="M:NPOI.DDF.EscherRecord.#ctor">
<summary>
Initializes a new instance of the <see cref="T:NPOI.DDF.EscherRecord"/> class.
</summary>
</member>
<member name="M:NPOI.DDF.EscherRecord.FillFields(System.Byte[],NPOI.DDF.IEscherRecordFactory)">
<summary>
Delegates to FillFields(byte[], int, EscherRecordFactory)
</summary>
<param name="data">The data.</param>
<param name="f">The f.</param>
<returns></returns>
</member>
<member name="M:NPOI.DDF.EscherRecord.FillFields(System.Byte[],System.Int32,NPOI.DDF.IEscherRecordFactory)">
<summary>
The contract of this method is to deSerialize an escher record including
it's children.
</summary>
<param name="data">The byte array containing the Serialized escher
records.</param>
<param name="offset">The offset into the byte array.</param>
<param name="recordFactory">A factory for creating new escher records.</param>
<returns>The number of bytes written.</returns>
</member>
<member name="M:NPOI.DDF.EscherRecord.ReadHeader(System.Byte[],System.Int32)">
<summary>
Reads the 8 byte header information and populates the
<c>options</c>
and
<c>recordId</c>
records.
</summary>
<param name="data">the byte array to Read from</param>
<param name="offset">the offset to start Reading from</param>
<returns>the number of bytes remaining in this record. This</returns>
</member>
<member name="M:NPOI.DDF.EscherRecord.ReadInstance(System.Byte[],System.Int32)">
<summary>
Read the options field from header and return instance part of it.
</summary>
<param name="data">the byte array to read from</param>
<param name="offset">the offset to start reading from</param>
<returns>value of instance part of options field</returns>
</member>
<member name="M:NPOI.DDF.EscherRecord.Serialize">
<summary>
Serializes to a new byte array. This is done by delegating to
Serialize(int, byte[]);
</summary>
<returns>the Serialized record.</returns>
</member>
<member name="M:NPOI.DDF.EscherRecord.Serialize(System.Int32,System.Byte[])">
<summary>
Serializes to an existing byte array without serialization listener.
This is done by delegating to Serialize(int, byte[], EscherSerializationListener).
</summary>
<param name="offset">the offset within the data byte array.</param>
<param name="data">the data array to Serialize to.</param>
<returns>The number of bytes written.</returns>
</member>
<member name="M:NPOI.DDF.EscherRecord.Serialize(System.Int32,System.Byte[],NPOI.DDF.EscherSerializationListener)">
<summary>
Serializes the record to an existing byte array.
</summary>
<param name="offset">the offset within the byte array.</param>
<param name="data">the offset within the byte array</param>
<param name="listener">a listener for begin and end serialization events. This.
is useful because the serialization is
hierarchical/recursive and sometimes you need to be able
break into that.
</param>
<returns></returns>
</member>
<member name="M:NPOI.DDF.EscherRecord.Clone">
<summary>
Creates a new object that is a copy of the current instance.
</summary>
<returns>
A new object that is a copy of this instance.
</returns>
</member>
<member name="M:NPOI.DDF.EscherRecord.GetChild(System.Int32)">
<summary>
Returns the indexed child record.
</summary>
<param name="index">The index.</param>
<returns></returns>
</member>
<member name="M:NPOI.DDF.EscherRecord.Display(System.Int32)">
<summary>
The display methods allows escher variables to print the record names
according to their hierarchy.
</summary>
<param name="indent">The current indent level.</param>
</member>
<member name="M:NPOI.DDF.EscherRecord.ToXml(System.String)">
@param tab - each children must be a right of his parent
@return xml representation of this record
</member>
<member name="P:NPOI.DDF.EscherRecord.IsContainerRecord">
<summary>
Determine whether this is a container record by inspecting the option
field.
</summary>
<value>
<c>true</c> if this instance is container record; otherwise, <c>false</c>.
</value>
</member>
<member name="P:NPOI.DDF.EscherRecord.Options">
<summary>
Gets or sets the options field for this record. All records have one
</summary>
<value>The options.</value>
</member>
<member name="P:NPOI.DDF.EscherRecord.RecordSize">
<summary>
Subclasses should effeciently return the number of bytes required to
Serialize the record.
</summary>
<value>number of bytes</value>
</member>
<member name="P:NPOI.DDF.EscherRecord.RecordId">
<summary>
Return the current record id.
</summary>
<value>The 16 bit record id.</value>
</member>
<member name="P:NPOI.DDF.EscherRecord.ChildRecords">
<summary>
Gets or sets the child records.
</summary>
<value>Returns the children of this record. By default this will
be an empty list. EscherCotainerRecord is the only record that may contain children.</value>
</member>
<member name="P:NPOI.DDF.EscherRecord.RecordName">
<summary>
Gets the name of the record.
</summary>
<value>The name of the record.</value>
</member>
<member name="P:NPOI.DDF.EscherRecord.Instance">
<summary>
Get or set the instance part of the option record.
</summary>
</member>
<member name="P:NPOI.DDF.EscherRecord.Version">
<summary>
Get or set the version part of the option record.
</summary>
</member>
<member name="T:NPOI.DDF.EscherRecord.DeleteEscherRecordHeader">
<summary>
This class Reads the standard escher header.
</summary>
</member>
<member name="M:NPOI.DDF.EscherRecord.DeleteEscherRecordHeader.R
基于NPOI的xls帮助类(03,07)

NPOI是一个强大的开源库,专门用于处理Microsoft Office文件,包括Excel(.xls和.xlsx格式)。这个“基于NPOI的xls帮助类”显然提供了一种方便的方式来读取和写入Excel文件,无论它们是2003版的.xls格式还是2007以后的.xlsx格式。下面将详细介绍NPOI库以及如何使用它来处理xls文件。
**NPOI库介绍**
NPOI是.NET平台上对Apache POI的封装,Apache POI是Java社区的一个项目,用于处理Microsoft Office文档。NPOI使得.NET开发者也能方便地处理Excel、Word等Office文档。它提供了API,允许程序创建、修改和显示Excel文件,无需依赖Microsoft Excel。
**支持的格式**
NPOI支持两种主要的Excel文件格式:
1. **.xls (BIFF8)**:这是Excel 97到2003使用的格式,基于二进制文件格式(BIFF)。
2. **.xlsx (OOXML)**:自Excel 2007以来,Microsoft引入了新的基于XML的文件格式,称为Office Open XML(OOXML)。
**导入和导出**
- **导入(读取)Excel文件**:使用NPOI,你可以轻松读取.xls或.xlsx文件中的数据。这通常通过`HSSFWorkbook`(对于.xls)或`XSSFWorkbook`(对于.xlsx)实现。这两个类提供了方法如`GetSheetAt()`来获取工作表,`GetRow()`获取行,`GetCell()`获取单元格,然后可以读取单元格的内容。
- **导出(写入)Excel文件**:创建新文件或向现有文件添加数据也是NPOI的核心功能。你可以创建一个新的`HSSFWorkbook`或`XSSFWorkbook`实例,添加工作表,创建行和单元格,最后将工作簿保存为文件。
**使用示例**
以下是一个简单的NPOI使用示例,演示如何创建一个Excel文件并写入数据:
```csharp
using NPOI.HSSF.usermodel; // for .xls
using NPOI.XSSF.usermodel; // for .xlsx
// 写入.xls文件
using (var file = new HSSFWorkbook())
{
var sheet = file.CreateSheet("Sheet1");
var row = sheet.CreateRow(0);
var cell = row.CreateCell(0);
cell.SetCellValue("Hello, NPOI!");
using (var stream = new FileStream("output.xls", FileMode.Create, FileAccess.Write))
file.Write(stream);
}
// 写入.xlsx文件
using (var file = new XSSFWorkbook())
{
var sheet = file.CreateSheet("Sheet1");
var row = sheet.CreateRow(0);
var cell = row.CreateCell(0);
cell.SetCellValue("Hello, NPOI! (in xlsx)");
using (var stream = new FileStream("output.xlsx", FileMode.Create, FileAccess.Write))
file.Write(stream);
}
```
**注意事项**
1. 文件流的管理非常重要,确保在使用完工作簿后立即关闭,以释放资源。
2. 对于大型数据集,考虑使用内存流或分批处理,以避免内存占用过大。
3. 考虑异常处理,因为文件操作可能会出现错误,如文件已存在、磁盘空间不足等。
这个"基于NPOI的xls帮助类"可能已经对这些基本操作进行了封装,提供了更友好的接口和更高级的功能,例如数据验证、样式设置、图表创建等。使用这样的帮助类,开发者可以更专注于业务逻辑,而不用关心底层的文件操作细节。不过,具体的实现细节需要查看源代码才能了解。

by_封爱
- 粉丝: 631
最新资源
- 我国施工企业信息化发展战略.pptx
- 学院通信系统综合项目实习报告.doc
- 计算机基础PPT-6(1).pptx
- 工学MCS单片机指令系统.pptx
- 办公自动化专业大学生职业规划书.doc
- 有关软件工作计划4篇.doc
- 《JavaWeb程序开发入门》课后练习(含答案).doc
- 国家开放大学电大专科《轨道交通信号与通信系统》2021期末试题.docx
- SAP软件教学实习报告.doc
- (完整版)软件测试报告实例.doc
- 中小学高中生物总复习-专题一基因工程省名师优质课赛课获奖课件市赛课一等奖课件.ppt
- 最新电大《计算机图像处理》形考作业任务01-03网考试题.docx
- 浅议变频器与PLC连接时注意的问题.doc
- 在软件开发企业中构建以实训为主的员工培训体系.doc
- GSP计算机系统的操作规程.doc
- 2011.03调度自动化培训总结.doc
- 1
- 2
- 3
- 4
- 5
- 6
前往页