Search in sources :

Example 1 with WritableCellFormat

use of jxl.write.WritableCellFormat in project cubrid-manager by CUBRID.

the class ExportErrorDataProgress method getTitleCell.

/**
	 * getNormalCell
	 * @return WritableCellFormat
	 */
public static WritableCellFormat getTitleCell() {
    WritableFont font = new WritableFont(WritableFont.TIMES, 12);
    WritableCellFormat format = new WritableCellFormat(font);
    try {
        format.setAlignment(jxl.format.Alignment.CENTRE);
        format.setVerticalAlignment(jxl.format.VerticalAlignment.CENTRE);
        format.setBorder(Border.ALL, BorderLineStyle.THIN, Colour.BLACK);
        format.setWrap(true);
    } catch (WriteException e) {
        LOGGER.error("", e);
    }
    return format;
}
Also used : WriteException(jxl.write.WriteException) WritableFont(jxl.write.WritableFont) WritableCellFormat(jxl.write.WritableCellFormat)

Example 2 with WritableCellFormat

use of jxl.write.WritableCellFormat in project cubrid-manager by CUBRID.

the class ExportErrorDataProgress method getNormalCell.

/**
	 * getNormalCell
	 * @return WritableCellFormat
	 */
public static WritableCellFormat getNormalCell() {
    // FIXME logic code move to core module
    WritableFont font = new WritableFont(WritableFont.TIMES, 12);
    WritableCellFormat format = new WritableCellFormat(font);
    try {
        format.setAlignment(jxl.format.Alignment.LEFT);
        format.setVerticalAlignment(jxl.format.VerticalAlignment.CENTRE);
        format.setBorder(Border.ALL, BorderLineStyle.THIN, Colour.BLACK);
        format.setWrap(true);
    } catch (WriteException e) {
        LOGGER.error("", e);
    }
    return format;
}
Also used : WriteException(jxl.write.WriteException) WritableFont(jxl.write.WritableFont) WritableCellFormat(jxl.write.WritableCellFormat)

Example 3 with WritableCellFormat

use of jxl.write.WritableCellFormat in project cubrid-manager by CUBRID.

the class RunSQLProcessManager method getNormalCell.

/**
	 * getNormalCell
	 * @return WritableCellFormat
	 */
public static WritableCellFormat getNormalCell() {
    // FIXME logic code move to core module
    WritableFont font = new WritableFont(WritableFont.TIMES, 12);
    WritableCellFormat format = new WritableCellFormat(font);
    try {
        format.setAlignment(jxl.format.Alignment.CENTRE);
        format.setVerticalAlignment(jxl.format.VerticalAlignment.CENTRE);
        format.setBorder(Border.ALL, BorderLineStyle.THIN, Colour.BLACK);
        format.setWrap(true);
    } catch (WriteException e) {
        LOGGER.error(e.getMessage(), e);
    }
    return format;
}
Also used : WriteException(jxl.write.WriteException) WritableFont(jxl.write.WritableFont) WritableCellFormat(jxl.write.WritableCellFormat)

Example 4 with WritableCellFormat

use of jxl.write.WritableCellFormat in project cubrid-manager by CUBRID.

the class ExportHostStatusDialog method saveTableData.

private void saveTableData(String columnName, String content, String sheetName, int sheetIndex) throws RowsExceededException, WriteException {
    WritableCellFormat normalCellStyle = getNormalCell();
    WritableSheet ws = wwb.createSheet(sheetName, sheetIndex);
    ws.addCell(new jxl.write.Label(0, 0, columnName, normalCellStyle));
    ws.setColumnView(0, 30);
    ws.addCell(new jxl.write.Label(0, 1, content, normalCellStyle));
}
Also used : WritableSheet(jxl.write.WritableSheet) WritableCellFormat(jxl.write.WritableCellFormat)

Example 5 with WritableCellFormat

use of jxl.write.WritableCellFormat in project cubrid-manager by CUBRID.

the class ExportHostStatusDialog method saveTableData.

private void saveTableData(Table table, String sheetName, int sheetIndex) throws RowsExceededException, WriteException {
    WritableCellFormat normalCellStyle = getNormalCell();
    WritableSheet ws = wwb.createSheet(sheetName, sheetIndex);
    int rowIndex = 0;
    //title
    for (int j = 0; j < table.getColumnCount(); j++) {
        String cellString = table.getColumn(j).getText();
        ws.addCell(new jxl.write.Label(j, rowIndex, cellString, normalCellStyle));
        ws.setColumnView(j, 30);
    }
    rowIndex++;
    //row
    for (int j = 0; j < table.getItemCount(); j++) {
        TableItem tableItem = table.getItem(j);
        for (int k = 0; k < table.getColumnCount(); k++) {
            String cellString = tableItem.getText(k);
            ws.addCell(new jxl.write.Label(k, rowIndex, cellString, normalCellStyle));
        }
        rowIndex++;
    }
}
Also used : TableItem(org.eclipse.swt.widgets.TableItem) WritableSheet(jxl.write.WritableSheet) WritableCellFormat(jxl.write.WritableCellFormat)

Aggregations

WritableCellFormat (jxl.write.WritableCellFormat)36 WritableFont (jxl.write.WritableFont)26 WriteException (jxl.write.WriteException)19 WritableSheet (jxl.write.WritableSheet)11 WorkbookSettings (jxl.WorkbookSettings)7 Label (jxl.write.Label)7 WritableWorkbook (jxl.write.WritableWorkbook)7 IOException (java.io.IOException)5 CellView (jxl.CellView)5 File (java.io.File)4 UnsupportedEncodingException (java.io.UnsupportedEncodingException)3 Date (java.util.Date)3 CellFormat (jxl.format.CellFormat)3 TableItem (org.eclipse.swt.widgets.TableItem)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 List (java.util.List)2 BiffException (jxl.read.biff.BiffException)2 DateTime (jxl.write.DateTime)2 KettleException (org.pentaho.di.core.exception.KettleException)2 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)2