jxl.write.DateTime类的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(8.5k)|赞(0)|评价(0)|浏览(287)

本文整理了Java中jxl.write.DateTime类的一些代码示例,展示了DateTime类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DateTime类的具体详情如下:
包路径:jxl.write.DateTime
类名称:DateTime

DateTime介绍

[英]A Date which may be created on the fly by a user application and added to a spreadsheet NOTE: By default, all dates will have local timezone information added to their UTC value. If this is not desired (eg. if the date entered represents an interval eg. 9.83s for the 100m world record, then use the overloaded constructor which indicate that the date passed in was created under the GMT timezone. It is important that when the date was created, an instruction like Calendar.setTimeZone(TimeZone.getTimeZone("GMT")) was made prior to that
[中]可由用户应用程序动态创建并添加到电子表格中的日期注:默认情况下,所有日期都将本地时区信息添加到其UTC值中。如果不需要这样做(例如,如果输入的日期表示100米世界记录的间隔,例如9.83秒,则使用重载构造函数,指示传入的日期是在GMT时区下创建的。重要的是,在创建日期时,会发出类似Calendar.setTimeZone(timezone.getTimeZone(“GMT”))的指令在此之前

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

DateTime dateTime = new DateTime( data.positionX, data.positionY, vMeta.getDate( v ), cellFormat );
 data.sheet.addCell( dateTime );
} else if ( !meta.isNullBlank() ) {

代码示例来源:origin: net.sourceforge.jexcelapi/jxl

cal.set(1998, 1, 18, 11, 23, 28);
Date d = cal.getTime();
dt.setDate(d);

代码示例来源:origin: com.hynnet/jxl

cal.set(1998, 1, 18, 11, 23, 28);
Date d = cal.getTime();
dt.setDate(d);

代码示例来源:origin: com.hynnet/jxl

/**
  * Implementation of the deep copy function
  *
  * @param col the column which the new cell will occupy
  * @param row the row which the new cell will occupy
  * @return  a copy of this cell, which can then be added to the sheet
  */
 public WritableCell copyTo(int col, int row)
 {
  return new DateTime(col, row, this);
 }
}

代码示例来源:origin: net.sourceforge.jexcelapi/jxl

/**
  * Implementation of the deep copy function
  *
  * @param col the column which the new cell will occupy
  * @param row the row which the new cell will occupy
  * @return  a copy of this cell, which can then be added to the sheet
  */
 public WritableCell copyTo(int col, int row)
 {
  return new DateTime(col, row, this);
 }
}

代码示例来源:origin: org.jboss.seam/jboss-seam-excel

return new DateTime(column, row, (Date) data, cellFormat);
} catch (ClassCastException e) {
  String message = Interpolator.instance().interpolate(ResourceBundle.instance().getString("org.jboss.seam.excel.not_a_date"), data.toString());

代码示例来源:origin: org.icefaces/icefaces-compat

cell = new DateTime(col, row, (Date) output);

代码示例来源:origin: jasperreports/jasperreports

public void handle(DateTextValue textValue) throws JRException
{
  baseStyle.setDisplayFormat(getDateFormat(textValue.getPattern()));
  WritableCellFormat cellStyle = getLoadedCellStyle(baseStyle);
  if (textValue.getValue() == null)
  {
    result = blank(cellStyle);
  }
  else
  {
    result = new DateTime(x, y, textValue.getValue(), cellStyle);
  }
}

代码示例来源:origin: com.hynnet/jxl

DateTime dt = new DateTime(0,2,date, cf1, DateTime.GMT);
s.addCell(dt);
dt = new DateTime(0,3,date, cf1,DateTime.GMT);
s.addCell(dt);
dt = new DateTime(0,4,date, cf1);
s.addCell(dt);
dt = new DateTime(0,5,date, cf1);
s.addCell(dt);
dt = new DateTime(0,6,date, cf1);
s.addCell(dt);
dt = new DateTime(0,7,date, cf1);
s.addCell(dt);
dt = new DateTime(0,8,date, cf1, DateTime.GMT);
s.addCell(dt);
dt = new DateTime(0,9,date, cf1, DateTime.GMT);
s.addCell(dt);
dt = new DateTime(0,10,date, cf1, DateTime.GMT);
s.addCell(dt);
dt = new DateTime(0,11,date, cf1, DateTime.GMT);
s.addCell(dt);

代码示例来源:origin: net.sourceforge.jexcelapi/jxl

DateTime dt = new DateTime(0,2,date, cf1, DateTime.GMT);
s.addCell(dt);
dt = new DateTime(0,3,date, cf1,DateTime.GMT);
s.addCell(dt);
dt = new DateTime(0,4,date, cf1);
s.addCell(dt);
dt = new DateTime(0,5,date, cf1);
s.addCell(dt);
dt = new DateTime(0,6,date, cf1);
s.addCell(dt);
dt = new DateTime(0,7,date, cf1);
s.addCell(dt);
dt = new DateTime(0,8,date, cf1, DateTime.GMT);
s.addCell(dt);
dt = new DateTime(0,9,date, cf1, DateTime.GMT);
s.addCell(dt);
dt = new DateTime(0,10,date, cf1, DateTime.GMT);
s.addCell(dt);
dt = new DateTime(0,11,date, cf1, DateTime.GMT);
s.addCell(dt);

代码示例来源:origin: cn-cerc/summer-mis

protected void writeColumn(WritableSheet sheet, int col, int row, Column column)
    throws WriteException, RowsExceededException {
  if (column instanceof NumberColumn) {
    jxl.write.Number item = new jxl.write.Number(col, row, (double) column.getValue());
    sheet.addCell(item);
  } else if (column instanceof DateColumn) {
    TDate day = (TDate) column.getValue();
    DateTime item = new DateTime(col, row, day.getData(), new WritableCellFormat(df1));
    sheet.addCell(item);
  } else if (column instanceof DateTimeColumn) {
    DateTime item = new DateTime(col, row, (Date) column.getValue(), new WritableCellFormat(df2));
    sheet.addCell(item);
  } else {
    Label item = new Label(col, row, column.getValue().toString());
    sheet.addCell(item);
  }
}

代码示例来源:origin: org.jxls/jxls-jexcel

break;
case DATE:
  writableCell = new DateTime(col, row, (Date)evaluationResult );
  break;
default:

代码示例来源:origin: us.ihmc/simulation-construction-set-tools

private void writeInfoToWorkBook(WritableWorkbook workbook)
{
 WritableSheet infoSheet = workbook.createSheet("Run info", workbook.getNumberOfSheets());
 int labelColumn = 0;
 int dataColumn = 1;
 int row = 0;
 addStringToSheet(infoSheet, labelColumn, row, "Date: ", headerCellFormat);
 WritableCell dateCell = new DateTime(dataColumn, row, Date.from(ZonedDateTime.now().toInstant()));
 addCell(infoSheet, dateCell);
 row++;
 addStringToSheet(infoSheet, labelColumn, row, "Robot type: ", headerCellFormat);
 addStringToSheet(infoSheet, dataColumn, row, robot.getClass().getSimpleName());
 row++;
 addStringToSheet(infoSheet, labelColumn, row, "Robot name: ", headerCellFormat);
 addStringToSheet(infoSheet, dataColumn, row, robot.getName());
 row++;
 addStringToSheet(infoSheet, labelColumn, row, "Total mass [kg]: ", headerCellFormat);
 addNumberToSheet(infoSheet, dataColumn, row, robot.computeCenterOfMass(new Point3D()));
 row++;
 addStringToSheet(infoSheet, labelColumn, row, "Run time [s]: ", headerCellFormat);
 addNumberToSheet(infoSheet, dataColumn, row, dataBuffer.getEntry(robot.getYoTime()).getMax());
 row++;
 addStringToSheet(infoSheet, labelColumn, row, "Mechanical cost of transport: ", headerCellFormat);
 addNumberToSheet(infoSheet, dataColumn, row, computeMechanicalCostOfTransport());
 row++;
}

代码示例来源:origin: youngMen1/JAVA-

Double.valueOf(String.valueOf(o)), wcfFC));
} else if (type == CellType.DATE || type == CellType.DATE_FORMULA) {
  wsheet.addCell(new jxl.write.DateTime(col, row, DateUtil.stringToDate(o
    .toString()), wcfFC));
} else {

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-common

_feuille.addCell(new jxl.write.DateTime(col, lig, (Date) value, format));
} else {

代码示例来源:origin: org.n52.sensorweb/sensorwebclient-api

Date date = timePos.getCalendar().getTime();
sheet.addCell(new DateTime(2, counter + 1, date, dateFormat));

代码示例来源:origin: com.manydesigns/elements

public  void addFieldToCell(WritableSheet sheet, int i, int j, Field field) throws WriteException {
 if (field instanceof NumericField) {
  NumericField numField = (NumericField) field;
  if (numField.getValue() != null) {
   jxl.write.Number number;
   BigDecimal decimalValue = numField.getValue();
   if (numField.getDecimalFormat() == null) {
    number = new Number(j, i, decimalValue == null ? null : decimalValue.doubleValue());
   } else {
    number = new Number(j, i, decimalValue == null ? null : decimalValue.doubleValue(),
     getNumberFormat(numField.getDecimalFormat().toPattern()));
   }
   sheet.addCell(number);
  }
 } else if (field instanceof PasswordField) {
  Label label = new Label(j, i, PasswordField.PASSWORD_PLACEHOLDER);
  sheet.addCell(label);
 } else if (field instanceof DateField) {
  DateField dateField = (DateField) field;
  DateTime dateCell;
  Date date = dateField.getValue();
  if (date != null) {
   dateCell = new DateTime(j, i, date, getDateFormat(dateField.getDatePattern()));
   sheet.addCell(dateCell);
  }
 } else {
  Label label = new Label(j, i, field.getStringValue());
  sheet.addCell(label);
 }
}

代码示例来源:origin: ManyDesigns/Portofino

public  void addFieldToCell(WritableSheet sheet, int i, int j, Field field) throws WriteException {
 if (field instanceof NumericField) {
  NumericField numField = (NumericField) field;
  if (numField.getValue() != null) {
   jxl.write.Number number;
   BigDecimal decimalValue = numField.getValue();
   if (numField.getDecimalFormat() == null) {
    number = new Number(j, i, decimalValue == null ? null : decimalValue.doubleValue());
   } else {
    number = new Number(j, i, decimalValue == null ? null : decimalValue.doubleValue(),
     getNumberFormat(numField.getDecimalFormat().toPattern()));
   }
   sheet.addCell(number);
  }
 } else if (field instanceof PasswordField) {
  Label label = new Label(j, i, PasswordField.PASSWORD_PLACEHOLDER);
  sheet.addCell(label);
 } else if (field instanceof DateField) {
  DateField dateField = (DateField) field;
  DateTime dateCell;
  Date date = dateField.getValue();
  if (date != null) {
   dateCell = new DateTime(j, i, date, getDateFormat(dateField.getDatePattern()));
   sheet.addCell(dateCell);
  }
 } else {
  Label label = new Label(j, i, field.getStringValue());
  sheet.addCell(label);
 }
}

代码示例来源:origin: net.sourceforge.jexcelapi/jxl

newCell = new DateTime((DateCell) cell);

代码示例来源:origin: org.xworker/xworker_dataobject

if(value != null){
  jxl.write.WritableCellFormat sf = "date".equals(type) ? dateCellFormat : timeCellFormat;
  DateTime dt = new DateTime(col, row, value, sf);
  sheet.addCell(dt);
}else{

相关文章