poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 24239] - Can't used tranditional Chinese
Date Thu, 30 Oct 2003 06:21:55 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24239>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24239

Can't used tranditional Chinese





------- Additional Comments From mike62@ms58.hinet.net  2003-10-30 06:21 -------
import java.io.IOException;
import java.io.File;
import java.io.FileWriter;
import java.io.FileOutputStream;

import org.apache.poi.hssf.usermodel.*;


/**
*
*
*
*
*@author:S.Ping-Chen
*@date:10/30/2003
*@version:1.0
*/

public class WriteExcel {

	/**
	 * 
	 * Creation date: 10/29/2003
	 * to generate xls file 
	 */
	public void writeExcel() {
			try {
   			
   			File f =new File
("c:"+File.separator+"temp"+File.separator+"test.xls");
   			
   		 	HSSFWorkbook wb = new HSSFWorkbook();
   		 	HSSFSheet sheet = wb.createSheet("UserAccount");
   		 	
   		 	HSSFFont font =wb.createFont();
   		 	font.setFontName("新細明體");
    			//font.setItalic(true);
    			//font.setStrikeout(true);
   		 	HSSFCellStyle cellStyle =wb.createCellStyle(); 
   		 	cellStyle.setFont(font);

   		 	//HSSFCell cell =null;
   		 	//cell.setCellStyle(cellStyle);
   		 	System.out.println("line 165 === "+font.getFontName());
   		 	HSSFRow row =null;
   		 	
   		 	row= sheet.createRow((short)0);
   		 	row.createCell((short)0).setCellValue("公司");
   		 	row.createCell((short)1).setCellValue("使用者");
   		 	row.createCell((short)2).setCellValue("密碼"); 		
	
   			
   		 	// Write the output to a file
   		 	FileOutputStream fileOut = new FileOutputStream(f);
   		 	wb.write(fileOut);
   		 	fileOut.close();
   		 	               
   		}catch(IOException ex){}
	
	}
	
	public static void main(String args[]) {
		   
				WriteExcel vendorInfo =new WriteExcel();	
				vendorInfo.writeExcel();			
		
				
	}	
	
}

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-dev-help@jakarta.apache.org


Mime
View raw message