<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 5,  comments - 7,  trackbacks - 0
     1package test;
     2
     3import java.io.FileOutputStream;
     4import java.io.IOException;
     5
     6import org.apache.poi.hssf.usermodel.HSSFCell;
     7import org.apache.poi.hssf.usermodel.HSSFCellStyle;
     8import org.apache.poi.hssf.usermodel.HSSFFont;
     9import org.apache.poi.hssf.usermodel.HSSFPrintSetup;
    10import org.apache.poi.hssf.usermodel.HSSFRichTextString;
    11import org.apache.poi.hssf.usermodel.HSSFRow;
    12import org.apache.poi.hssf.usermodel.HSSFSheet;
    13import org.apache.poi.hssf.usermodel.HSSFWorkbook;
    14
    15public class ExcelTest {
    16
    17    public static void main(String[] args) throws IOException {
    18        
    19         // create a new file  
    20         FileOutputStream out = new FileOutputStream("D:/workbook.xls");  
    21         // create a new workbook  
    22         HSSFWorkbook wb = new HSSFWorkbook();  
    23         // create a new sheet  
    24         HSSFSheet sheet = wb.createSheet();  
    25           
    26         //2.model  
    27         HSSFRow row = sheet.createRow(2);  
    28         row.setHeightInPoints(20);  
    29         HSSFCell cell = row.createCell(2);  
    30         HSSFFont cnFont = wb.createFont();  
    31         cnFont.setFontHeightInPoints((short10);  
    32         //font.setFontName("漢儀報(bào)宋簡(jiǎn)");  
    33         cnFont.setFontName("隸書");  
    34         HSSFCellStyle cnStyle = wb.createCellStyle();  
    35         cnStyle.setFont(cnFont);  
    36         cell.setCellStyle(cnStyle);  
    37         HSSFRichTextString richText = new HSSFRichTextString("中文字體測(cè)試");  
    38         cell.setCellValue(richText);  
    39         HSSFCell enCell = row.createCell(3);  
    40         HSSFFont enFont = wb.createFont();  
    41         enFont.setFontHeightInPoints((short10);  
    42         enFont.setFontName("Arial Black");  
    43         HSSFCellStyle enStyle = wb.createCellStyle();  
    44         enStyle.setFont(enFont);  
    45         enCell.setCellStyle(enStyle);  
    46         enCell.setCellValue(new HSSFRichTextString("English font test"));  
    47         sheet.setColumnWidth(24000);  
    48         sheet.setColumnWidth(34000);
    49         
    50         //3.output  
    51         sheet.setDisplayGridlines(false);  
    52         sheet.setPrintGridlines(false);  
    53         HSSFPrintSetup printSetup = sheet.getPrintSetup();  
    54         //A4紙
    55         printSetup.setPaperSize(HSSFPrintSetup.A4_PAPERSIZE);  
    56         wb.write(out);  
    57         out.close(); 
    58    }

    59}

    60
    posted on 2008-11-25 11:47 Vincent-chen 閱讀(2188) 評(píng)論(0)  編輯  收藏 所屬分類: POIPrint
    主站蜘蛛池模板: 污污的视频在线免费观看| 亚洲 欧洲 日韩 综合在线| 成人免费网站久久久| 国产色爽女小说免费看| 亚洲精华液一二三产区| 最近最新中文字幕完整版免费高清 | 成年女人免费视频播放体验区| 亚洲精品美女在线观看| 午夜免费福利视频| 亚洲白嫩在线观看| 99无码人妻一区二区三区免费 | 亚洲国产一二三精品无码| 亚洲欧洲日产国码二区首页 | 四虎永久在线精品免费一区二区| 国产国产成年年人免费看片| 朝桐光亚洲专区在线中文字幕| 国产免费观看黄AV片| 五月天国产成人AV免费观看| 亚洲一区无码中文字幕| 免费国产午夜高清在线视频| 亚洲精品视频在线观看免费| 午夜宅男在线永久免费观看网| 亚洲AV无码片一区二区三区| 亚洲爽爽一区二区三区| 久久伊人免费视频| 亚洲一级视频在线观看| 免费a级毛片网站| 久久久精品免费视频| 亚洲a级成人片在线观看| 在线免费观看韩国a视频| 成人毛片100免费观看| 久久亚洲私人国产精品| 好男人看视频免费2019中文 | 亚洲美免无码中文字幕在线| 大陆一级毛片免费视频观看i| 国产精品免费αv视频| 亚洲天堂一区二区三区四区| 亚洲精品网站在线观看不卡无广告 | 青青操视频在线免费观看| 亚洲成a人片7777| 亚洲AV伊人久久青青草原|