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

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

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

    posts - 21,  comments - 6,  trackbacks - 0

    /*
    ?* Created on 2006-9-13
    ?*/
    package com.livedoor.finance.credit.admin.business.event.service;

    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.OutputStream;

    import org.apache.poi.hssf.usermodel.HSSFCell;
    import org.apache.poi.hssf.usermodel.HSSFCellStyle;
    import org.apache.poi.hssf.usermodel.HSSFFont;
    import org.apache.poi.hssf.usermodel.HSSFRow;
    import org.apache.poi.hssf.usermodel.HSSFSheet;
    import org.apache.poi.hssf.usermodel.HSSFWorkbook;
    import org.apache.poi.hssf.util.Region;

    /**
    ?* @author Warren~@_@
    ?*/
    public class CatOutputSpecification2 {
    ??? HSSFWorkbook hssfWorkbook;
    ??? HSSFSheet hssfSheet;
    ??? HSSFRow hssfRow;
    ??? HSSFCell hssfCell;
    ???
    ??? OutputStream out;
    ???
    ??? private String fontName = "MS Pゴシツク";
    ??? private short fontSize = (short) 11;
    ??? private short fontTitleSize = (short) 16;
    ???
    ??? public CatOutputSpecification2() {
    ???????
    ??? }
    ???
    ??? public static void main(String[] args) {
    ??????? CatOutputSpecification2 cat = new CatOutputSpecification2();
    ??????? cat.executeExcel();
    ???????
    ??????? System.out.println("========");
    ??? }
    ???
    ??? public void executeExcel() {
    ??????? String filePath = null;
    ??????? FileOutputStream fos = null;
    ???????
    ??????? filePath = "./data/testPOI.xls";
    ???????
    ??????? try {
    ??????????? fos = new FileOutputStream(filePath);
    ???????????
    ??????????? generate(fos);
    ???????????
    ??????????? fos.close();
    ??????? } catch (FileNotFoundException e) {
    ??????????? // TODO Auto-generated catch block
    ??????????? e.printStackTrace();
    ??????? } catch (IOException e) {
    ??????????? // TODO Auto-generated catch block
    ??????????? e.printStackTrace();
    ??????? }
    ??? }

    ??? /**
    ???? * @param fos
    ???? */
    ??? private void generate(OutputStream out) {
    ??????? // TODO Auto-generated method stub
    ??????? this.out = out;
    ???????
    ??????? drawWB();
    ??? }

    ??? /**
    ???? *
    ???? */
    ??? private void drawWB() {
    ??????? // TODO Auto-generated method stub
    ??????? hssfWorkbook = new HSSFWorkbook();
    ???????
    ??????? hssfSheet = hssfWorkbook.createSheet();
    ??????? hssfWorkbook.setSheetName(0, "test", HSSFWorkbook.ENCODING_UTF_16);
    ???????
    ??????? hssfSheet.setDisplayGridlines(true);
    ???????
    ??????? for (int i = 0; i < 30; i++) {
    ??????????? hssfSheet.setColumnWidth((short) i, (short) (4.25 * 256));
    ??????? }
    ???????
    ??????? drawCell();
    ???????
    ??????? try {
    ??????????? hssfWorkbook.write(out);
    ??????? } catch (IOException e) {
    ??????????? // TODO Auto-generated catch block
    ??????????? e.printStackTrace();
    ??????? }
    ??? }

    ??? /**
    ???? *
    ???? */
    ??? private void drawCell() {
    ??????? // 1~2 row
    ??????? HSSFRow row_001 = hssfSheet.createRow(1);
    ??????? HSSFRow row_002 = hssfSheet.createRow(2);
    ???????
    ??????? HSSFCell cell_001_000 = row_001.createCell((short) 0);
    ??????? HSSFCell cell_002_029 = row_002.createCell((short) 29);
    ???????
    ??????? hssfSheet.addMergedRegion(new Region(1, (short) 0, 2, (short) 29));
    ???????
    ??????? // 4 row
    ??????? HSSFRow row_004 = hssfSheet.createRow(4);
    ???????
    ??????? HSSFCell cell_004_001 = row_004.createCell((short) 1);
    ??????? HSSFCell cell_004_005 = row_004.createCell((short) 5);
    ??????? HSSFCell cell_004_013 = row_004.createCell((short) 13);
    ???????
    ??????? hssfSheet.addMergedRegion(new Region(4, (short) 5, 4, (short) 13));
    ???????
    ??????? // 5~11 row
    ??????? HSSFRow row_005 = hssfSheet.createRow(5);
    ??????? HSSFRow row_011 = hssfSheet.createRow(11);
    ???????
    ??????? HSSFCell cell_005_000 = row_005.createCell((short) 0);
    ??????? HSSFCell cell_011_029 = row_011.createCell((short) 29);
    ???????
    ??????? hssfSheet.addMergedRegion(new Region(5, (short) 0, 11, (short) 29));
    ???????
    ??????? // 13 row
    ??????? HSSFRow row_013 = hssfSheet.createRow(13);
    ???????
    ??????? HSSFCell cell_013_000 = row_013.createCell((short) 0);
    ???????
    ??????? // 14 row
    ??????? HSSFRow row_014 = hssfSheet.createRow(14);
    ???????
    ??????? HSSFCell cell_014_001 = row_014.createCell((short) 1);
    ??????? HSSFCell cell_014_007 = row_014.createCell((short) 7);
    ??????? HSSFCell cell_014_008 = row_014.createCell((short) 8);
    ??????? HSSFCell cell_014_027 = row_014.createCell((short) 27);
    ???????
    ??????? hssfSheet.addMergedRegion(new Region(14, (short) 1, 14, (short) 7));
    ??????? hssfSheet.addMergedRegion(new Region(14, (short) 8, 14, (short) 27));
    ???????
    ??????? // 15 row
    ??????? HSSFRow row_015 = hssfSheet.createRow(14);
    ???????
    ??????? HSSFCell cell_015_001 = row_015.createCell((short) 1);
    ??????? HSSFCell cell_015_007 = row_015.createCell((short) 7);
    ??????? HSSFCell cell_015_008 = row_015.createCell((short) 8);
    ??????? HSSFCell cell_015_027 = row_015.createCell((short) 27);
    ???????
    ??????? hssfSheet.addMergedRegion(new Region(15, (short) 1, 15, (short) 7));
    ??????? hssfSheet.addMergedRegion(new Region(15, (short) 8, 15, (short) 27));
    ???????
    ??????? // 16 row
    ??????? HSSFRow row_016 = hssfSheet.createRow(14);
    ???????
    ??????? HSSFCell cell_016_001 = row_016.createCell((short) 1);
    ??????? HSSFCell cell_016_007 = row_016.createCell((short) 7);
    ??????? HSSFCell cell_016_008 = row_016.createCell((short) 8);
    ??????? HSSFCell cell_016_027 = row_016.createCell((short) 27);
    ???????
    ??????? hssfSheet.addMergedRegion(new Region(16, (short) 1, 16, (short) 7));
    ??????? hssfSheet.addMergedRegion(new Region(16, (short) 8, 16, (short) 27));
    ???????
    ??????? // 17 row
    ??????? HSSFRow row_017 = hssfSheet.createRow(14);
    ???????
    ??????? HSSFCell cell_017_001 = row_017.createCell((short) 1);
    ??????? HSSFCell cell_017_007 = row_017.createCell((short) 7);
    ??????? HSSFCell cell_017_008 = row_017.createCell((short) 8);
    ??????? HSSFCell cell_017_027 = row_017.createCell((short) 27);
    ???????
    ??????? hssfSheet.addMergedRegion(new Region(17, (short) 1, 17, (short) 7));
    ??????? hssfSheet.addMergedRegion(new Region(17, (short) 8, 17, (short) 27));
    ???????
    ??????? // 18 row
    ??????? HSSFRow row_018 = hssfSheet.createRow(14);
    ???????
    ??????? HSSFCell cell_018_001 = row_018.createCell((short) 1);
    ??????? HSSFCell cell_018_007 = row_018.createCell((short) 7);
    ??????? HSSFCell cell_018_008 = row_018.createCell((short) 8);
    ??????? HSSFCell cell_018_027 = row_018.createCell((short) 27);
    ???????
    ??????? hssfSheet.addMergedRegion(new Region(18, (short) 1, 18, (short) 7));
    ??????? hssfSheet.addMergedRegion(new Region(18, (short) 8, 18, (short) 27));
    ???????
    ??????? // 19 row
    ??????? HSSFRow row_019 = hssfSheet.createRow(14);
    ???????
    ??????? HSSFCell cell_019_001 = row_019.createCell((short) 1);
    ??????? HSSFCell cell_019_007 = row_019.createCell((short) 7);
    ??????? HSSFCell cell_019_008 = row_019.createCell((short) 8);
    ??????? HSSFCell cell_019_027 = row_019.createCell((short) 27);
    ???????
    ??????? hssfSheet.addMergedRegion(new Region(19, (short) 1, 19, (short) 7));
    ??????? hssfSheet.addMergedRegion(new Region(19, (short) 8, 19, (short) 27));
    ???????
    ??????? // set style
    ??????? cell_001_000.setCellStyle(cellStyle_title());
    ???????
    ??????? // set encoding
    ??????? cell_001_000.setEncoding(HSSFCell.ENCODING_UTF_16);
    ?
    ??????? // set value
    ??????? cell_001_000.setCellValue("テクス");
    ??? }

    ??? /**
    ???? * @return style_title
    ???? */
    ??? private HSSFCellStyle cellStyle_title() {
    ??????? HSSFCellStyle style_title = hssfWorkbook.createCellStyle();
    ??????? style_title.setFont(getFont_title());
    ??????? style_title.setVerticalAlignment(HSSFCellStyle.ALIGN_CENTER);
    ??????? return style_title;
    ??? }

    ??? /**
    ???? * @return font_title
    ???? */
    ??? private HSSFFont getFont_title() {
    ??????? HSSFFont font_title = hssfWorkbook.createFont();
    ??????? font_title.setFontName(fontName);
    ??????? font_title.setFontHeightInPoints(fontTitleSize);
    ??????? font_title.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
    ??????? return font_title;
    ??? }
    }
    ~@_@

    posted on 2006-09-19 17:13 Warren.Wu 閱讀(314) 評(píng)論(0)  編輯  收藏

    只有注冊(cè)用戶(hù)登錄后才能發(fā)表評(píng)論。


    網(wǎng)站導(dǎo)航:
     
    主站蜘蛛池模板: 好爽好紧好大的免费视频国产| 理论亚洲区美一区二区三区| 久久精品毛片免费观看| 亚洲成A∨人片在线观看无码| 国产精品亚洲一区二区在线观看 | 亚洲最大av资源站无码av网址| 国产99精品一区二区三区免费 | 国外成人免费高清激情视频 | 成人精品国产亚洲欧洲| 亚洲日韩精品一区二区三区无码 | 青草草在线视频永久免费| 无码人妻一区二区三区免费视频 | 亚洲色图激情文学| 豆国产96在线|亚洲| 伊人久久大香线蕉亚洲| 美女视频黄免费亚洲| 国产一级在线免费观看| 亚洲人成色77777在线观看| 亚洲VA中文字幕无码一二三区| 一级毛片成人免费看a| 亚洲无砖砖区免费| 亚洲永久无码3D动漫一区| 免费看片A级毛片免费看| 在线观看肉片AV网站免费| 亚洲AV无码一区二区三区鸳鸯影院| 全免费a级毛片免费**视频| baoyu777永久免费视频 | 久久久久久国产a免费观看不卡| 尤物永久免费AV无码网站| 日韩中文字幕免费视频| 九九九精品视频免费| 亚洲免费综合色在线视频| 亚洲欧洲日产v特级毛片| 亚洲国产精品无码专区| 亚洲精品国产V片在线观看| 国内自产拍自a免费毛片| 亚洲人成免费网站| 国产精品免费无遮挡无码永久视频| 亚洲精品影院久久久久久| 久久精品国产精品亚洲精品 | 日本黄页网站免费|