import java.io.File;

import jxl.CellView;
import jxl.Workbook;
import jxl.format.Alignment;
import jxl.format.Border;
import jxl.format.BorderLineStyle;
import jxl.format.Colour;
import jxl.format.UnderlineStyle;
import jxl.write.Label;
import jxl.write.WritableSheet;
import jxl.write.NumberFormats;
import jxl.format.VerticalAlignment;
import jxl.write.WritableCellFormat;
import jxl.write.WritableFont;
import jxl.write.WritableWorkbook;
import jxl.write.WriteException;

public class Excel {
    private static final String TAG = "Excel";

    private static final String TABLE_HEADER[] = { "A", "B", "C", "D", "E",
            "F", "G", "H", "I", "crash", "G", "K", "L" };

    , , , , , ,
            , , , , , ,  };

    private String name;
    private WritableCellFormat headerDefaultFormat;
    private WritableCellFormat cellDefaultFormat;

    private int minTimeIndex;

    private WritableCellFormat getHeaderCellDefaultStyle() {
        // WritableFont.createFont("宋体"):设置字体为宋体 10:设置字体大小
        // WritableFont.BOLD:设置字体加粗(BOLD:加粗 NO_BOLD:不加粗) false:设置非斜体
        // UnderlineStyle.NO_UNDERLINE:没有下划线
        WritableFont font = ,
                WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE);
        WritableCellFormat format = new WritableCellFormat();
        format.setFont(font);

        try {
            format.setWrap(false);
            // 设置单元格背景色
            format.setBackground(Colour.GREEN);
            format.setVerticalAlignment(VerticalAlignment.CENTRE);
            // 表头内容水平居中显示
            format.setAlignment(Alignment.CENTRE);
            // format.setShrinkToFit(true);
            // 设置表头表格边框样式,整个表格线为粗线、黑色
            format.setBorder(Border.ALL, BorderLineStyle.THIN, Colour.BLACK);
        } catch (WriteException e) {
            Log.e(TAG, "Fail to getHeaderCellDefaultStyle():");
            Log.e(TAG, e.getMessage());
        }

        return format;
    }

    private WritableCellFormat getNormalCellStyle() {
        WritableFont font = ,
                WritableFont.NO_BOLD, false, UnderlineStyle.NO_UNDERLINE);
        WritableCellFormat format = new WritableCellFormat(NumberFormats.TEXT);
        format.setFont(font);
        try {
            format.setBackground(Colour.BLACK);
            format.setVerticalAlignment(VerticalAlignment.CENTRE);
            format.setAlignment(Alignment.CENTRE);
            format.setBorder(Border.ALL, BorderLineStyle.THIN, Colour.BLACK);
        } catch (WriteException e) {
            Log.e(TAG, "Fail to getNormalCellStyle():");
            Log.e(TAG, e.getMessage());
        }

        return format;
    }
}

jxl_1的更多相关文章

随机推荐

  1. 跟着思维导图学习javascript

    1.javascript 变量 2.javascript 运算符 3.javascript 数组 4.javascript 流程语句 5.javascript字符串函数 6.javascript 函数 ...

  2. Windows下使用VisualSVN Server搭建SVN服务器

    使用 VisualSVN Server来实现主要的 SVN功能则要比使用原始的 SVN和 Apache相配合来实现源代码的 SVN管理简单的多,下面就看看详细的说明. VisualSVN Server ...

  3. AD10的PCB设计规则

    PCB布线规则,布板需要注意的点很多,但是基本上注意到了下面的这此规则,LAYOUT PCB应该会比较好,不管是高速还是低频电路,都基本如此. 1. 一般规则 1.1 PCB板上预划分数字.模拟.DA ...

  4. Leetcode: LFU Cache && Summary of various Sets: HashSet, TreeSet, LinkedHashSet

    Design and implement a data structure for Least Frequently Used (LFU) cache. It should support the f ...

  5. SetSysColors 修改系统颜色

    首先我们来看一下SetSysColors函数的原型: BOOL WINAPI SetSysColors( __in int cElements, //要改变的对象的数量 __in const INT* ...

  6. YUM源

    由于自己想做一个简单的博客玩玩,需要去搭建apache,mysql和php,如果只是用rpm安装包的话,安装的速度太慢不说,最主要的是包之间的关联太让人蛋疼了,所以最好还是是用yum来安装吧,当然这只 ...

  7. SecureCRT:保存输出日志的方法

    处理地址: http://blog.sina.com.cn/s/blog_64c1dd210101gzgz.html 或者: http://renchen.blog.51cto.com/4531967 ...

  8. 很好用的request转换为实体方法还有判断实体所有参数不能为空的方法

    /// <summary> /// 模型辅助处理类 /// 2016-04-18 /// </summary> public class ModelHelper { /// & ...

  9. 使用openssl的一些问题

    openssl编译后,会生成bin,include,lib文件夹: 写了一个简单的例子:#include <openssl/md5.h> #include <openssl/evp. ...

  10. push or get File or Folder using scp wrapped with expect and bash

    经常需要把服务器的某些文件传到 Mac,或者获取 Mac 的一些文件到服务器.尽管有很多命令scp, ftp, rsync都可以,霸特每次都有敲好长的命令,好烦,而且还要输入密码.所以想着 wrap ...