Introduction to Java Excel API (translation)

xiaoxiao2021-03-06  55

Introduction to Java Excel API (translation)

Copyright Notice: 9CBS is this BLOG managed service provider. If this paper involves copyright issues, 9CBS does not assume relevant responsibilities, please contact the copyright owner directly with the article Author.

I. Introduction Java Excel API is an open source Java API that allows Java developers to generate an Excel spreadsheet. In addition, it includes a mechanism that allows Java applications to read Excel, modify some cells, written to a new spreadsheet. This set of API allows a pure Java application that processes and submits Excel spreadsheets, running under non-Windows operating systems. Because of Java, this API can be called in a servlet; so through it can access Excel's functionality through web applications in Internet and corporate network; II. Features: 1) Read the data of Excel95, 97, 2000; 2) Reading and writing EXCEL97 and subsequent formula; 3) Generate spreadsheets in Excel2000 format; 4) Support for font, numbers, date formatting; 5) Support for cell plus shadow and add color; 6) Modify presence Worksheet; 7) Support for images; 8) logging can be customized; three. Limitations: Jexcelapi cannot generate and read information about the chart; this information is still saved when the chart is copied; when a picture is added In the table, only the PNG format is supported. (This part I don't understand) IV. Start using: This section will use a lot of demo to explain the use of this API; 1) Read the worksheet: When reading a worksheet, the demo is used as In a reasonable way, in accordance with the original format into CSV and XML format; java -jar jxl.jar -csv myspreadsheet.xls To view the table to XML, call the following demo: java -jar JXL. JAR -XML MySpreadsheet.xls In order to introduce XLRD / CSV.java and XLRD / XML.java, more work is required; this class is only started; from http://www.andykhan.com/jexcelapi/tutorial .html # reading can get a guide. 2) Generate Worksheet This write demo clarifies the most easily understood features of Jexcelapi in the generation of worksheets; worksheets pass this demonstration process with different fonts, digital formats, date formats, coloring, and the border processing; The worksheet, the JEXCELAPI call method is as follows: java -jar jxl.jar -write myspreadsheet.xls This will generate a sample worksheet called myspreadsheet.xls in the current directory; the class used to generate a worksheet is usually JXL / Write.java . This may be used in a display process; 3) Copying electronic data sheet JEXceLAPI can also be used to copy and modify worksheets; including Jexcelapi called JXLRWTest.xls electronic data table, is a robust demos; The command line is running this electronic data table, then a copy of the electronic data table will be generated, and the second worksheet includes a modified value. Do not modify the demo's electronic data table, otherwise modifying the demo will not be able to run. Run the presentation from the directory containing jxlrwtest.xls; java -jar jxl.jar -rw jxlrwtest.xls myoutput.xls demo will generate an electronic data table called myoutput.xls, the first worksheet (called "initial ") There is no change, but the second work table (called" modified ") The title specified cell content changes.

转载请注明原文地址:https://www.9cbs.com/read-113953.html

New Post(0)