ExcelManager--基于.Net的Excel读写管理类库(二)

下面是此管理类库的接口类描述,以及相关源码文档使用手册等。
在仅使用时直接引用两个管理类(在DLL.rar包中)即可。
欢迎大家指点。。。

ContractedBlock.gif ExpandedBlockStart.gif 接口类
  1ExpandedBlockStart.gifContractedBlock.gif/**//* -----------------------------------------------------------------------
  2InBlock.gif *    版权所有: 版权所有(C) 2006,EYE(Ver1.1)
  3InBlock.gif *    文件编号: 0003
  4InBlock.gif *    文件名称: IExcelManager.cs
  5InBlock.gif *    系统编号: E-Eye_0001
  6InBlock.gif *    系统名称: SFWL管理系统
  7InBlock.gif *    模块编号: 0001
  8InBlock.gif *    模块名称: Excel数据管理对象接口
  9InBlock.gif *    设计文档: 
 10InBlock.gif *    完成日期: 2006-5-12 10:33:56
 11InBlock.gif *    作  者: 林付国
 12InBlock.gif *    内容摘要: 完成Excel数据管理对象API接口定义
 13InBlock.gif *    属性描述: 该接口有10个属性
 14InBlock.gif *                    01 DataSource            数据源
 15InBlock.gif *                    02 Title                Excel文件表格标题
 16InBlock.gif *                    03 FilePath                源文件路径
 17InBlock.gif *                    04 XMLFilePath            XML架构文件路径
 18InBlock.gif *                      05 IsOpen                判断Excel管理对象是否已经打开
 19InBlock.gif *                    06 WriteType            写入类型(普通,重写,追加)
 20InBlock.gif *                    07 SheetName            Sheet表名称
 21InBlock.gif *                    08 BackColor            背景颜色
 22InBlock.gif *                    09 ForeColor            字体颜色
 23InBlock.gif *                    10 Font                    字体样式
 24InBlock.gif *    方法描述: 该接口包括10个方法:
 25InBlock.gif *                    01 Open                    打开Excel管理对象
 26InBlock.gif *                    02 Read                    读取Excel文件中有效行列数据集
 27InBlock.gif *                    03 ReadCell                读取某单元格的内容
 28InBlock.gif *                    04 ReadCell                读取某单元格的内容,按行,列方式
 29InBlock.gif *                    05 Write                写入至Excel文件中
 30InBlock.gif *                    06 ReWrite                按照指定重写行重写数据
 31InBlock.gif *                    07 WriteCell            写数据至单元格
 32InBlock.gif *                    08 Close                资源释放
 33InBlock.gif *                    09 OpenCreate            打开Excel管理对象,若Excel文件不存在则创建之
 34InBlock.gif *                    10 ActiveSheet            激活当前读写数据的Sheet表
 35InBlock.gif *    文件调用:无
 36InBlock.gif *      约    束:1.执行导出机器上需要装有Office组件,且Excel文件版本在2000以上
 37InBlock.gif *                2.Excel读文件目前仅支持单工作簿,单工作表读取
 38InBlock.gif *                3.需读取Excel文件,在第一行必须依次存储二个范围,用于限定参数状态位,依次为:需要读取的起始单元格名称,结束单元格名称
 39InBlock.gif *                4.需读取的每个Excel数据文件,必须有于之配对的同名XML架构文件(扩展项可支持不同文件名,不推荐此项)
 40InBlock.gif *                5.写文件时,推荐先建立空Excel文件(扩展项可支持自动创建Excel文件,不推荐此项),本版本暂不提供数据插入功能
 41InBlock.gif *                6.写入至Excel文件,提供(普通,Insert重写,Append追加)三种操作方式
 42InBlock.gif *                    数据量的大小要求单次写入:行1--60000以内,列1-255,Cell值长度1-255字符 
 43InBlock.gif *                    目前写操作仅支持单工作簿,最大存在32个Sheet,每Sheet最大存储量为60000行
 44InBlock.gif *                7.其它约束按照.Net框架及Microsoft Office Excel相关约定。
 45InBlock.gif *    -----------------------------------------------------------------------
 46ExpandedBlockEnd.gif * */

 47None.gif
 48None.gifusing System;
 49None.gifusing System.Collections;
 50None.gifusing System.Data;
 51None.gif
 52None.gifnamespace las.foundation.Interfaces
 53ExpandedBlockStart.gifContractedBlock.gifdot.gif{
 54ExpandedSubBlockStart.gifContractedSubBlock.gif    /**//// 类 编 号: 01
 55InBlock.gif    /// 类 名 称: IExcelManager
 56InBlock.gif    /// 内容摘要: Excel管理对象接口
 57InBlock.gif    /// 完成日期: 2006-5-12 14:36:51
 58ExpandedSubBlockEnd.gif    /// 编码作者: 林付国

 59InBlock.gif    public interface IExcelManager : IDisposable
 60ExpandedSubBlockStart.gifContractedSubBlock.gif    dot.gif{
 61ContractedSubBlock.gifExpandedSubBlockStart.gif        Property#region Property
 62ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
 63InBlock.gif        /// 数据源
 64ExpandedSubBlockEnd.gif        /// </summary>

 65ExpandedSubBlockStart.gifContractedSubBlock.gif        DataSet DataSourcedot.gif{get;set;}
 66ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
 67InBlock.gif        /// Excel文件表格标题
 68ExpandedSubBlockEnd.gif        /// </summary>

 69ExpandedSubBlockStart.gifContractedSubBlock.gif        string Titledot.gif{get;set;}
 70ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
 71InBlock.gif        /// 源文件路径
 72ExpandedSubBlockEnd.gif        /// </summary>

 73ExpandedSubBlockStart.gifContractedSubBlock.gif        string FilePathdot.gif{get;set;}
 74ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
 75InBlock.gif        /// XML架构文件路径
 76ExpandedSubBlockEnd.gif        /// </summary>

 77ExpandedSubBlockStart.gifContractedSubBlock.gif        string XMLFilePathdot.gif{get;set;}
 78ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
 79InBlock.gif        /// 判断Excel管理对象是否已经打开
 80InBlock.gif        /// </summary>
 81ExpandedSubBlockEnd.gif        /// <returns></returns>

 82ExpandedSubBlockStart.gifContractedSubBlock.gif        bool IsOpendot.gif{get;}
 83ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
 84InBlock.gif        /// Excel文件写入类型
 85ExpandedSubBlockEnd.gif        /// </summary>

 86ExpandedSubBlockStart.gifContractedSubBlock.gif        EnumType.WriteType WriteTypedot.gif{get;set;}
 87ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
 88InBlock.gif        /// Sheet表名称
 89ExpandedSubBlockEnd.gif        /// </summary>

 90ExpandedSubBlockStart.gifContractedSubBlock.gif        string SheetNamedot.gif{get;set;}
 91ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
 92InBlock.gif        /// 背景颜色
 93ExpandedSubBlockEnd.gif        /// </summary>

 94ExpandedSubBlockStart.gifContractedSubBlock.gif        System.Drawing.Color BackColordot.gif{get;set;}
 95ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
 96InBlock.gif        /// 字体颜色
 97ExpandedSubBlockEnd.gif        /// </summary>

 98ExpandedSubBlockStart.gifContractedSubBlock.gif        System.Drawing.Color ForeColordot.gif{get;set;}
 99ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
100InBlock.gif        /// 字体样式
101ExpandedSubBlockEnd.gif        /// </summary>

102ExpandedSubBlockStart.gifContractedSubBlock.gif        System.Drawing.Font Fontdot.gif{get;set;}
103ExpandedSubBlockEnd.gif        #endregion

104InBlock.gif
105ContractedSubBlock.gifExpandedSubBlockStart.gif        Private Method#region Private Method
106ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
107InBlock.gif        /// 打开Excel管理对象
108InBlock.gif        /// </summary>
109ExpandedSubBlockEnd.gif        /// <returns></returns>

110InBlock.gif        bool Open();
111ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
112InBlock.gif        /// 读取Excel文件中有效行列数据集
113InBlock.gif        /// </summary>
114ExpandedSubBlockEnd.gif        /// <returns></returns>

115InBlock.gif        DataSet Read();
116ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
117InBlock.gif        /// 读取某单元格的内容
118InBlock.gif        /// </summary>
119InBlock.gif        /// <param name="strCell">单元格名称</param>
120ExpandedSubBlockEnd.gif        /// <returns></returns>

121InBlock.gif        string ReadCell(string strCell);
122ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
123InBlock.gif        /// 读取某单元格内容,按行列参数方式
124InBlock.gif        /// </summary>
125InBlock.gif        /// <param name="iRow"></param>
126InBlock.gif        /// <param name="iCol"></param>
127ExpandedSubBlockEnd.gif        /// <returns></returns>

128InBlock.gif        string ReadCell(int iRow,int iCol);
129ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
130InBlock.gif        /// 写入数据集到Excel文件
131InBlock.gif        /// </summary>
132ExpandedSubBlockEnd.gif        /// <returns></returns>

133InBlock.gif        bool Write();
134ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
135InBlock.gif        /// 重写数据集到Excel文件,指定重写行
136InBlock.gif        /// </summary>
137InBlock.gif        /// <param name="iRow"></param>
138ExpandedSubBlockEnd.gif        /// <returns></returns>

139InBlock.gif        bool ReWrite(int iRow);
140ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
141InBlock.gif        /// 写数据至单元格
142ExpandedSubBlockEnd.gif        /// </summary>

143InBlock.gif        bool WriteCell(int iRow,int iCol,string strValue);
144ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
145InBlock.gif        /// 活动的Sheet表
146InBlock.gif        /// </summary>
147ExpandedSubBlockEnd.gif        /// <param name="sheetindex"></param>

148InBlock.gif        void ActiveSheet(EnumType.SheetIndex sheetindex);
149ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
150InBlock.gif        /// 资源释放
151ExpandedSubBlockEnd.gif        /// </summary>

152InBlock.gif        void Close();
153ExpandedSubBlockStart.gifContractedSubBlock.gif        /**//// <summary>
154InBlock.gif        /// 打开并创建此对象
155InBlock.gif        /// </summary>
156ExpandedSubBlockEnd.gif        /// <returns></returns>

157InBlock.gif        bool OpenCreate();
158ExpandedSubBlockEnd.gif        #endregion

159ExpandedSubBlockEnd.gif    }

160ExpandedBlockEnd.gif}

161None.gif


1.使用说明
word使用手册
相关DLL文件

2.所有源码
sourcecode1
sourcecode2
(可以下载了,下载后把文件解压到某一文件夹中即可)
(传不上去文件,凌晨时传的非常好,现在修改后传不上去了,估计是我这网络问题,唉,算了,改天传吧)

好了,基本上需要用到的东东都已经发出来的,如果那里还有没说明白的地方,欢迎与我联系,共同探讨!14.gif
另外,对JavaExcelAPI有研究的朋友,如有时间可以一起考虑将其转为.net版本的啊,毕竟有需求。

注:C#版本的JavaExcelAPI在SF上已被重构,感兴趣的朋友可去SF下载:
http://sourceforge.net/projects/nexcel  
(以前未作细查,感谢精浪的提醒)
终于发完了,哇塞,快两点了,太晚了,偶要睡去了...09.gif09.gif09.gif

转载于:https://www.cnblogs.com/linfuguo/archive/2006/08/19/480978.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值