http://www.andykhan.com/excelread/
ExcelRead - A Java API to read Excel 97 spreadsheets
ExcelRead - A Java API to read Excel 97 spreadsheets
解决方案 »
- sleep() 和Thread.sleep()疑惑,请大家指点!
- 正数数列与负数数列在N~M范围内的所有组合
- 提问一道scjp的题。
- 在java中如何实现从一个文本文件中读取浮点数据(多组),并将其依次放入数组中?
- 初学JAVA,一个SERVLET问题,请大家来看看~
- 西安哪个IT培训机构比较好?
- 一道关于Unicode字符转换的简单题(在线等,简单题,一有正确答案,立刻给分!)
- JTree的节点已经发生变化,如何刷新JTree(再线等待)
- 一个关于ResultSet的问题
- 谁能告诉我回车的ascii码是多少?(10进制的)
- SCJP有没有用
- 违理问题2:jbInit()中没有catch()块,当法生违例,程序如何处理?是结束程序码并告知错误吗
有一个包可以实现,如下,要的话我寄给你?或是你自已找一下吧。Welcome to the ExcelAccessor Suite of Beans
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Overview
========The ExcelAccessor suite of beans provides you with the functionality to
visually program a Java application that can access the contents of an
Excel worksheet. The suite contains three non-visual beans that can be
easily wired with other beans in various IDE's to create applications. Excel provides a COM (Component Object Model) object that exposes
the API to access an Excel workbook. As Java cannot access the COM
object directly, it does so using the JNI (Java Native Interface).
The native C++ code that interacts with the COM object is wrapped in
a Dynamic Link Library (DLL), and accessed by a Java program using JNI.
Java provides a mechanism to load the DLL and invoke the functions on it.The ExcelAccessor bean suite consists of the following beans:ExcelWorkbook:
-------------------------
The ExcelWorkbook bean handles the workbook-related functionality including:- Opening the workbook
If the workbook is password-protected, the fetchPasswordEvent is
thrown to enable you to access the workbook in the required mode.
Once the workbook is opened, the bean gets the worksheets in the
workbook. The worksheets property is bound and contains the list
of worksheets in the workbook.
- Unprotected workbook structure.
The workbook structure needs to be unprotected (if it is
protected) before inserting or removing worksheets.
- Closing the workbook
On closing, the workbook is saved by default. However, the
closeWorkbook method fires fileSavingEvent to determine
whether the workbook changes are to be saved to the file.
Note: Before calling the closeWorkbook method, call the setValue
method.
ExcelRange:
--------------------------
The ExcelRange bean provides the functionality to access data from a
particular sheet in the workbook including the following:- The read/write cell properties such as value, formula, format,
text(read only), and noteText. While modifying the worksheet or
reading the hidden formulae, the worksheet needs unprotecting (if
it is password-protected). The fetchPasswordEvent event is fired
to get the password when the worksheet is unprotected. All the
above mentioned properties are bound. - The clear cell properties such as formats, contents, notes, or all
other (including value and formula).- Possibility to assign a name to a range (i.e. create a named range).- Insertion/removal worksheets in the workbook.- Possibility to unprotect the worksheet.ExcelCell:
--------------------------
The ExcelCell bean provides the functionality to access data from a single
cell in the workbook. It is similar in functionality to the ExcelRange
bean. However, if a range containing multiple cells is specified to the
ExcelCell bean, the bean operates only on the first cell (i.e. the cell
in the top-left corner) of the range.Limitations of the ExcelAccessor bean suite:
--------------------------------------------
The ExcelAccessor suite of beans has the following limitations:1. The beans provide no Array Formula functionality. In Excel, a group
of cells can be designated as an array and a formula associated
with the group. It is not possible to modify individual cells in
this array. In the bean suite, if the range you have selected contains
some cells of the array formula, it is not possible to modify the values
in these cells. In other words, these beans are able to write values
to the range, only if the range contains no cells of the array
formula. 2. If an Excel file contains external links (i.e. links to cells in other
workbooks), these links are not updated when the file is opened.
Thus, only the old values can be accessed for these cells.3. If a cell contains the time or currency information, the value property
is returned as a Double object. You may request the format information
to help in more detailed recognition of the data.4. For the large ranges there may be a delay in accessing the data (i.e.
during the initialization of the range, or setting the range
properties). This delay is proportional to the number of cells
in the range.5. The ExcelWorkbook bean supports valid .xls files only. The behavior
of the beans, when invalid files are supplied, is not defined.6. This suite of beans handles no other objects such as charts,
drawings, etc., which might be embedded inside an Excel file. These
beans concern themselves with cell data only (such as value, format,
formula, and noteText).7. If the workbook opened has any Auto_Open macros in it, they
are not executed when the bean opens the file.8. The ExcelRange bean works only with ranges, which are continuous,
i.e. the range cannot contain multiple areas.9. Since the beans use the native code, they cannot be used in an Applet.
Known Problems
==============General:
--------
1. In Excel v5.0, while removing the worksheet from the workbook, an Excel
confirmation dialog box pops up. The worksheet is deleted only if
you select "Yes". You can continue working with the beans after the
dialog is dismissed.2. While inserting a worksheet using the ExcelRange bean, a new worksheet
is added in the workbook. It is then renamed to the String set in the
'worksheetName' property of ExcelRange. If the renaming of the worksheet
fails, the newly inserted worksheet is deleted. This deletion pops up a
confirmation dialog in Excel v5.0 (as in the item above).3. Excel v5.0 xls files can be opened and accessed using the ExcelAccessor
suite of beans, when the beans use Excel '97 or Excel 2000. However,
if you save changes in the workbook, an Excel 'Save As' dialog pops up.
Using this dialog, the file can be saved as required. If 'Cancel' is
pressed, the Excel application (which is running in the background and
is invisible) becomes visible.
BeanBox:
--------
1. As the beans use the native code, they do not work in the current version
(BDK July, 1998) of BeanBox. However, you can drop the beans in beanbox
and customize various properties.
IBM VisualAge for Java v2.0:
----------------------------1. The 'Rollup1' fixpack has to be installed. This fixpack can be downloaded
from the IBM VisualAge Web site.
IBM VisualAge for Java v3.0 Technology Preview:
-----------------------------------------------1. VA Java 3.0 Technology Preview does not show the specified value for
property 'workbookName' in the ExcelWorkbook, it is a VisualAge problem.Closing:
--------
1. When the application is closing (depending on virtual machines), the
finalize() method not is always called. To eliminate this problem, the
closeExcelApplication() method is created, which automatically closes
the workbook and unloads the application from the memory.