One: SceneUsing Word templates to implement dynamic word generationII: Basic Requirements1: Replace the contents of the text2: Replace the contents of the table (without dynamically generating the table)3: The replaced content should be the same format as before the replacement4: Easy to modify the template5: The effect is as follows:Template:Results:Three: POI analysisHow to use: directly read the Word file, replace the contents of the various parts
MAVEN-built Project-->pom.xml file
Eclipse provides dependencies to directly add dependent jar packages: Search for POI and poi-ooxml directly, and MAVEN will automatically rely on the jar package you need:
POI provides support for older versions of Microsoft Office, eg. xls Excel
Poi-ooxml
POI Excel and poiexcel
I. POI Overview
Apache POI is an open-source library of the Apache Software Foundation. POI provides APIs for Java programs to read and write Microsoft Office files.Structure:
HSSF-provides the ability to read and write Microsoft Excel files.
XSSF-provides the ability to read and writ
Use poi to read and write Excel
For a programmer, file operations are common, especially for Excel files.
Here I will introduce a POI tool used in the project to Operate Excel. There are many concepts about POI on the Internet. For more information, you can use Baidu. Here I will just give a brief introduction. POI is
first, let's focus on the two different formats of Excel, which directly affect how we use the POI to manipulate Excel. Be sure to first clear the version of Excel you want to work with, remember! 1,excel the two formats differ by a), the *.xls file is a spreadsheet saved using Microsoft Excel 2003 or a previous version, using a storage format of Biff (Binary Interchange file format), A special binary format file. b) The *.xlsx file is a spreadsheet s
The jar packages that need to be used are as follows:If you are a MAVEN managed project, add the following dependencies:Https://mvnrepository.com/artifact/org.apache.poi/poi - Dependency> groupId>Org.apache.poigroupId> Artifactid>PoiArtifactid> version>3.14version> Dependency> Https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml - Dependency> groupId>Org.apache.poigroupId>
Java poi import excel and poiexcel
Recently, the project needs to be imported into excel. There are many examples on the Internet. The integration records are compatible with 2003 and 2007, and the image processing function is not added yet.
Jar package http://pan.baidu.com/s/1sjPuWDR required
Package example. poi; import java. io. *; import java. text. decimalFormat; import org. apache.
For Java access to Excel files, commonly used components have JXL and poi, JXL because there is no version update, and only access to EXCEL2007 previous file format, the xlsx file format is not currently supported, it is recommended to use POI,The official POI is: http://poi.apache.org/In essence, the EXCEL2007 document is an XML document, so there are two ways t
Recently in the use of poi to write large amounts of data in Excel, found that excel2003 up to 65,535, a large number of data easily caused by oom, the internet looked up the API, found that for 2003, each sheet up to 65,535, if the amount of data is far more than 65535, It is recommended to sheet processing, and after poi3.8, there is sxssfworkbook, can support the large data volume write Excel operation, but currently only support excel2007HSSF is a
This function description, click on the Download button on the front page, start to download the required data, as follows:Google Chrome works as follows:Open Excel as follows:The Firefox browser works as follows:First to import the POI jar package, my project uses MAVEN management, so add is relatively simple, the following codeFind the project's Pom.xml file to join in Dependency> groupId>Org.apache.poigroupId> Artifactid>PoiArtifactid> ver
Java Solution for POI export Excel memory OverflowIn our use of Java development process, we often want to export the data obtained by the query, which is generally stored in Excel, so we export the data to use the Java POI Library, which is mainly for the various Windows Platform data format operation, here, We are working on Excel.The process of generating Excel is like this, first of all, we query the da
1. First download the Poi-3.6-20091214.jar, as follows:http://download.csdn.net/detail/evangel_z/38950512.student.javaImport Java.util.Date;public class Student{private int id;private String name;private int age;Private Date birth;Public Student (){}public Student (int ID, String name, Int. age, Date birth){This.id = ID;THIS.name = name;This.age = age;This.birth = birth;}public int getId (){return ID;}public void setId (int id){This.id = ID;}Public St
When you use a POI to update Excel, if cell a sets a formula, and when the other cells it depends on are populated with values, a in the exported Excel is still a formula instead of an auto-calculated value.Paste_image.pngThe score subtotal is not updated to the calculated results.WorkaroundThis interface is provided in the POI to org.apache.poi.ss.usermodel.FormulaEvaluator enable updates to the formula. W
Reading Excel data with POI: (version number: POI3.7)
1. Read Excel
Private list
2, Excel data processing:
The Excel store date and time are stored by numeric type, when reading POI first judge whether it is a numeric type, then make a judgment transformation
1, numerical format (cell_type_numeric):
1. Pure numerical format: Getnumericcellvalue () direct access to data
2. Date format: Deal with
Yesterday, the beta version of 3.5 was already supported by the 2007 Open XML Format (DOCX,PPTX,XLSX) for POI.
Need to join Poi-ooxml-3.5-beta6-xxxx.jar. But the Poi-ooxml-3.5-beta6-xxxx.jar package requires several packages under the Ooxml-lib directory to run.
The code is as follows
Import java.util.ArrayList; Import Java.io.File; Import Java.io.FileInputStr
Http://www.cnblogs.com/hongten/p/java_poi_excel.htmlThis blog is an introduction to the POI technology in Java to read Excel data and then save it to MySQL data.You can also read and import excel in: Java's POI technology to learn how to write Excel informationUsing JXL technology, you can import excel in Java's JXL technologyProject structure:Test data in Excel:Database structure:The corresponding SQL:1 CR
Read the following two forms of Excel: *.xls and *.xlsxUsing the Apache POI API, you need to use the HSSF and XSSF class librariesHSSF is the POI Project's pure Java implementation of the "Excel" ( -2007) (. xls) file format.XSSF is the POI Project's pure Java implementation of the Excel OOXML (. xlsx) file format.These 4 JARs is needed to read Excel:Add the four
HSSF is a pure Java implementation of POI Engineering for Excel 97 (-2007) file operationsXSSF is a pure Java implementation of the POI Project for Excel OOXML (. xlsx) file operationsThere is a Hssfpatriarch object in the POI, which is the top-level manager for Paint, and its createpicture (anchor, Pictureindex) method enables you to insert a picture in Excel.St
The JAVAWeb SSH framework exports EXCEL using POI, And the pop-up save box appears, javawebpoi
To import a package, simply paste the key code. JSP just needs to click an Action Link.
Poi pack I use: poi-3.11-20141221.jar
Valid for test:
Effect:
Action Code:
Private InputStream inputStream; // (get, set Method omitted) defines an input stream, used to catch th
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.