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. 生产/消费 发送和接收消息---基于kombu和redis交互

    from kombu import Connection, Exchange, Queue media_exchange = Exchange('media', 'direct', durable=T ...

  2. charles抓包工具的中文乱码解决方法

    charles是 MAC上最好用的抓包工具.charles 网上的参考文档已经很多,我就不再赘述啦.只是说说我在安装过程遇到的问题和解决方法,仅供参考. charles抓包的数据中的中文内容显示乱码, ...

  3. EaeyUI

    基础 定义 一个轻量级的JavaScript框架 基本用法 $(function(){代码}) 相当于window.load()(当窗口加载完毕后触发) 选择器是jQuery的根基 通过选择器选中元素 ...

  4. iis配置js支持读取json文件配置

    默认情况下,iis不支持解析.json文件,这就需要我们自己在iis下配置方法一:iis配置1.点击开始菜单选择控制面板: 2.控制面板内点击管理工具,选择Internet信息服务(IIS)管理器. ...

  5. REq,RES编码设置

    import java.io.IOException; import javax.servlet.Filter;import javax.servlet.FilterChain;import java ...

  6. android nfc中Ndef格式的读写

    1. 在onCreate()中获取NfcAdapter对象: NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(this); 2.在onNewI ...

  7. jQuery的13个优点

    1.轻量级 JQuery非常轻巧,采用Dean Edwards编写的Packer压缩后,大小不到30KB,如果使用Min版并且在服务器端启用Gzip压缩后,大小只有18KB. gzip: 每天一个li ...

  8. springMVC--@requestBody

    springMVC支持将前端传来的json字符串直接自动解析,注意点如下: 后台 1,在需要自动解析的参数前加上“@requestBody”,例如“public boolean updateOnePd ...

  9. Qt QObject

    [1]Qt的QObject 1.测试代码如下: #include<QApplication> #include<QPushButton> #include<QDebug& ...

  10. struts标签

    A:<s:a xhref=""></s:a>-----超链接,类似于html里的<a></a><s:action name=& ...