Search in sources :

Example 6 with WriteException

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

the class ExportHostStatusDialog method saveAllData.

private boolean saveAllData() {
    String fileName = saveExcelPath.getText() + saveExcelName.getText() + ".xls";
    WorkbookSettings workbookSettings = new WorkbookSettings();
    workbookSettings.setEncoding(fileCharsetCombo.getText());
    boolean isOK = true;
    try {
        wwb = Workbook.createWorkbook(new File(fileName), workbookSettings);
        /*System info*/
        saveTableData(com.cubrid.cubridmanager.ui.host.Messages.titleServerInfo, editor.getDbServerInfoText().getText(), com.cubrid.cubridmanager.ui.host.Messages.titleServerInfo, 0);
        /*DB info*/
        saveDBInfoData(editor.getDatabaseTable(), com.cubrid.cubridmanager.ui.host.Messages.titleDBInfo, 1);
        /*DB volume info*/
        saveTableData(editor.getVolumeTableViewer().getTable(), com.cubrid.cubridmanager.ui.host.Messages.titleVolumeInfo, 2);
        /*Broker info*/
        saveTableData(editor.getBrokerTableViewer().getTable(), com.cubrid.cubridmanager.ui.host.Messages.titleBrokerInfo, 3);
        /*System status*/
        saveTableData(editor.getServerTableViewer().getTable(), com.cubrid.cubridmanager.ui.host.Messages.titleSystemInfo, 4);
        wwb.write();
    } catch (IOException e) {
        isOK = false;
        LOGGER.error("Export to error", e);
    } catch (RowsExceededException e) {
        isOK = false;
        LOGGER.error("Export to error", e);
    } catch (WriteException e) {
        isOK = false;
        LOGGER.error("Export to error", e);
    } finally {
        if (wwb != null) {
            try {
                wwb.close();
            } catch (Exception ex) {
                LOGGER.error("close excel stream error", ex);
            }
        }
    }
    return isOK;
}
Also used : WriteException(jxl.write.WriteException) WorkbookSettings(jxl.WorkbookSettings) IOException(java.io.IOException) File(java.io.File) WriteException(jxl.write.WriteException) IOException(java.io.IOException) RowsExceededException(jxl.write.biff.RowsExceededException) RowsExceededException(jxl.write.biff.RowsExceededException)

Example 7 with WriteException

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

the class BrokerLogTopMergeProgress method getNormalCell.

/**
	 * getNormalCell
	 *
	 * @return WritableCellFormat
	 */
public static WritableCellFormat getNormalCell() {
    // FIXME move this logic to core module
    WritableFont font = new WritableFont(WritableFont.TIMES, 11);
    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 8 with WriteException

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

the class BrokerLogTopMergeProgress method getSQLCell.

/**
	 * getSQLCell
	 *
	 * @return WritableCellFormat
	 */
public static WritableCellFormat getSQLCell() {
    // FIXME move this logic to core module
    WritableFont font = new WritableFont(WritableFont.TIMES, 11);
    WritableCellFormat format = new WritableCellFormat(font);
    try {
        format.setAlignment(jxl.format.Alignment.LEFT);
        format.setVerticalAlignment(jxl.format.VerticalAlignment.TOP);
        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 9 with WriteException

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

the class ExportTableDefinitionLayoutType method getNormalRightAlignCellStyle.

/**
	 * GetNormalRightAlignCellStyle
	 *
	 * @return
	 */
public static WritableCellFormat getNormalRightAlignCellStyle() {
    WritableFont font = new WritableFont(WritableFont.ARIAL, 10);
    WritableCellFormat format = new WritableCellFormat(font);
    try {
        format.setAlignment(jxl.format.Alignment.RIGHT);
        format.setVerticalAlignment(jxl.format.VerticalAlignment.TOP);
        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 10 with WriteException

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

the class ExportTableDefinitionLayoutType method getNormalCenterAlignCellStyle.

/**
	 * GetNormalCell
	 *
	 * @return WritableCellFormat
	 */
public static WritableCellFormat getNormalCenterAlignCellStyle() {
    WritableFont font = new WritableFont(WritableFont.ARIAL, 10);
    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)

Aggregations

WriteException (jxl.write.WriteException)15 WritableCellFormat (jxl.write.WritableCellFormat)13 WritableFont (jxl.write.WritableFont)13 IOException (java.io.IOException)2 WorkbookSettings (jxl.WorkbookSettings)2 File (java.io.File)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 WritableSheet (jxl.write.WritableSheet)1 RowsExceededException (jxl.write.biff.RowsExceededException)1