Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML


 
  
 
Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML
 

 
Facing Programming Problem?
Ask Questions?, Browse Latest Questions, Question-Answer Guidelines
Java
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments

Compressed Unicode in Excel Using POI3.0

                         

In this program we are going to set the sheet name forcing the encoding.

The methods can be used for built in data format:


setSheetName(int sheet, String name): 
This method is used to set the sheet name. 

setSheetName(int sheet, String name, short encoding): 
This method is deprecated. In POI 3.0, now automatically detects unicode and sets the encoding appropriately. Simply use setSheetName(int sheet, String encoding)

setSheetName(int sheet, String name):
This method is used to set the sheet name. This method can  throw IllegalArgumentException if the name is greater than 31 chars or contains /\,?,*,[,],etc 

setSheetName( int sheet, String name, short encoding):
This method is also deprecated. Now POI3.0 automatically detects Unicode and sets the encoding appropriately. Simply use setSheetName(int sheet, String encoding) 
 
 The code of the program is given below:
import java.io.*;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.hssf.usermodel.HSSFRow;
class compressedUnicode
  {
    public static void main(String arg[]) {
try{
FileOutputStream out = new FileOutputStream
(
"compressedUnicode.xls");
HSSFWorkbook hssfworkbook = new HSSFWorkbook();
HSSFCellStyle cs = hssfworkbook.createCellStyle();
hssfworkbook.setSheetName(0"HSSF Test"
HSSFWorkbook.ENCODING_COMPRESSED_UNICODE 
);
hssfworkbook.write(out);
out.close();
}catch(Exception e){}
  }}

The output of the program is given below:

Download this example.

                         

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

1 comments so far (
post your own) View All Comments Latest 10 Comments:

i want free books related to all java plz inform me
about java updates

Posted by vishal bargode on Thursday, 05.8.08 @ 18:24pm | #58923

Latest Searches:
getthevalueofdropdowni
Cinema 4D Modelling Sw
saving files under fol
insert query in HQL
code for login page us
max length textarea
drop down list box
multipal page in singe
servletandajax
convert calendar to da
java convert int to st
passing values from js
Byte Stream
Combattons la programm
two dimensyonal array
populate list box
Struts 2 Tiles
Tree Grid using flex
difference between jav
how to get the time di
Java Interview Questio
Photoshop Photo Effect
Java code for Rounding
data input stream
primitive data types u
calculatorexampleinawt
jar coding
java games.
Photoshop Text Effects
program for saving fil
how to create Text in
Java code for media pl
onclick function examp
in mysql how to store
struts form validation
howtogetapplicatescope
Photoshop Matrix, Made
ASP Excel and ASP Crea
Hibernate can meet you
PHP Date and .../tools
howtoreadkeyvaluepairs
wth_small
callablestatement
Optgroup Tag (Form Tag
Where clause
B Tree in c
validateradiobuttonwit
merging pdf
3DS MAX Effects Advanc
struts pdf free down l
<c:forEach> in JSTL
oc4jjaznloginmodule
remove all elements fr
java Dinamyc string ar
Read the Key-Value of
login and logout
logout page in jsp
timer program for pic1
string array add eleme
email validation
Hashmap Arraylist]
Java General Java Enca
analog clock program i
fetching record throug
example for encapsulat
tomcat database conf
what is BufferedReader
actionproperties
CONNECT JAVA DAO MYSQL
how can i store into a
PHP Randomizing Random
array java
code for finding index
Use of <x:set> tag of
parsing XML data into
trim
create menubar
default path
convert linked list to
showfoldercontents
Java String toLowerCase Example
Java String toCharArray Example
Java String substring Example
Java String indexOf Example
Java String startsWith Example
Java String hashCode Example
Java String matches Example
Java String length Example
Java String lastIndexOf Example
Java String isEmpty Example
Java String equalsIgnoreCase Example
Java String equals Example
Java String endsWith Example
Java String copyValueOf Example
Java String contentEquals Example
  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.