Use Apache POI in Java to generate excel and Word documents
Overview:
Recently, when I was working on a project, I encountered the excel data export and word text table report export functions. Finally, I decided to use Apache POI to complete this function. This article shares some ideas and code in the project impleme
The Apache POI is an open source library of the Apache Software Foundation, and POI provides the ability for the API to read and write to Microsoft Office format files in Java programs.
1. Read the jar packs that Word 2003 and Word 2007 need
A Word file that reads Version
Overview:Recently in the process of doing the project encountered Excel data export and Word Chart Table report export function, and finally decided to use Apache poi to complete the function. This article on the project implementation process of some ideas and code to share with you, at the same time, also as a summary of their own, for later use. Function:1, from the database query data export to Excel;2
1, Stopanalyzer
Stopanalyzer can filter specific strings and words in a word and do uppercase to lowercase.
2, StandardAnalyzer
StandardAnalyzer according to the space and symbols to complete the participle, but also to complete the number, letter, e-mail address, IP address and Chinese character analysis and processing, but also can support the filter word list, to replace the Stopanalyzer can achieve t
1. stopanalyzer
Stopanalyzer can filter specific strings and words in words and convert them to lowercase letters.
2. standardanalyzer
Standardanalyzer performs Word Segmentation Based on Spaces and symbols. It can also analyze numbers, letters, e-mail addresses, IP addresses, and Chinese characters. It can also filter word lists, it is used to replace the filtering function implemented by stopanalyzer.
3.
; - - Dependency> in groupId>Fr.opensagres.xdocreportgroupId> - Artifactid>Fr.opensagres.xdocreport.documentArtifactid> to version>2.0.1version> + Dependency> - the Dependency> * groupId>Fr.opensagres.xdocreportgroupId> $ Artifactid>Org.apache.poi.xwpf.converter.coreArtifactid>Panax Notoginseng version>1.0.6version> - Dependency> the + Dependency> A gr
What if I need to analyze the access log now?Like analyzing D:\Servers\Apache2.2\logs\access2014-05-22.log .http://my.oschina.net/cart/ developed a gadget to analyze Apache logs, split the word interleaved CSV file and insert MySQL database analysis for this issuePHP$date= ' 2014-05-22 ';file_put_contents($date.‘. CSV ', ' ');file_put_contents($date.‘. CSV ', ' "IP", "Date", "Zone", "Protocol", "URL", "Vers
Word-wrap is the control of line-wrapping, preferably: Word-wrap:break-word normal Break-all Keep-all
Break-word: It is mainly used to control whether the word will be forced to change lines, there is no problem in Chinese and English, but for the long string of English is i
Need to implement the ability to export Word documents, online about POI generation of Word documents, few examples, looking for a long time to find a demo in the official website, with a demo everything will be good to do.
[Java] View Plain copy/*==================================================================== LicensedtotheApacheSoftwareFoundation (ASF) underone ormore contributorlicenseagreements.se
Original address: Click on the Open link
Displays the contents of various documents on the page. Logic in the servlet
Word:
Bufferedinputstream bis = null;URL url = null;HttpURLConnection httpurl = null; Create a linkurl = new URL (urlreal);Httpurl = (httpurlconnection) url.openconnection ();//Connection specified resourceHttpurl.connect ()//get network input streambis = new Bufferedinputstream (Httpurl.getinputstream ());
String bodyText = null;Word
First, modify the Apache default Site Directory
After the Apache HTTP server is installed, the default site directory is located in the Htdocs folder under its installation directory, and the default home page is the index.html file for that folder. For example, my Apache is installed inside c:/wamp/bin/apache/apache2
Machine Word Length: The number of bits that the CPU can process data at a time, usually related to the number of registers of the CPU.Storage Word Length: The number of bits of binary code stored by a storage unit (storage address) in memory, that is, the number of MDR in memory.Instruction word Length: The number of bits of the computer instruction character.Da
Environment: Window 7, apache/2.2.19 (WIN32) php/5.2.9-1
1. Configure the server name
Remove the #ServerName localhost:80 comments from the inside.
Re-run the Apache service.
The http://localhost:80 can then be accessed through a browser, which means that Apache has been installed and started successfully if the page is displayed.
2. Add PHP Support
Max is from the server with Apache and PHP, do not need to install additional, this article on the relevant configuration is described.
First: Apache
Enter the terminal and the following command will launch the Apache server:
Start sudo apachectl-k start //restart sudo apachectl-k restart
Verify:
Enter in the browser: http://127.0.0.1, displayed as it works!
The IIS server default port for window is also 80,
The Wamp Apache (httpd) default port is also 80,
Any port conflict caused by the Wamp open failure, causing wamp the lower right corner of the icon is yellow color (normal open green),
You can change the port number of Apache (httpd).
Specific programmes
To be replaced by:
Then restart the Wamp service, or the Wamp itself will be
The above descr
1. First, you need to install Apache service, here does not describe how to install.
2. First configure window virtual domain to open hosts
Path is C:\WINDOWS\SYSTEM32\DRIVERS\ETC
After opening, write the domain name in the inside like www.cms.com
3. Modify the Apache configuration file httpd.conf
Found it
Remove the note
Modify
To open state
4. Modify Apa
Recently in the system to the customer, the user asked for the need to be able to import Word files, now Microsoft Word has several versions 97, 2003, 2007, the three versions of the format of data storage is quite different, and now 97 has basically exited the market, Few people use this version, so in our system only consider 2003 version and 2007 version, because we only need to be able to read
The previous summary is the use of Lucene standard word breaker, which is for the English language, but the Chinese language is not helpful, because the Chinese vocabulary and English is different, so generally when we develop, have Chinese words
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.