本文整理了Java中org.apache.poi.ss.usermodel.Row.setRowStyle
方法的一些代码示例,展示了Row.setRowStyle
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Row.setRowStyle
方法的具体详情如下:
包路径:org.apache.poi.ss.usermodel.Row
类名称:Row
方法名:setRowStyle
[英]Applies a whole-row cell styling to the row.
[中]
代码示例来源:origin: looly/hutool
/**
* 获取或创建某一行的样式,返回样式后可以设置样式内容
*
* @param y Y坐标,从0计数,既行号
* @return {@link CellStyle}
* @since 4.1.4
*/
public CellStyle getOrCreateRowStyle(int y) {
final Row row = getOrCreateRow(y);
CellStyle rowStyle = row.getRowStyle();
if (null == rowStyle) {
rowStyle = this.workbook.createCellStyle();
row.setRowStyle(rowStyle);
}
return rowStyle;
}
代码示例来源:origin: looly/hutool
/**
* 获取或创建某一行的样式,返回样式后可以设置样式内容
*
* @param y Y坐标,从0计数,既行号
* @return {@link CellStyle}
* @since 4.1.4
*/
public CellStyle getOrCreateRowStyle(int y) {
final Row row = getOrCreateRow(y);
CellStyle rowStyle = row.getRowStyle();
if (null == rowStyle) {
rowStyle = this.workbook.createCellStyle();
row.setRowStyle(rowStyle);
}
return rowStyle;
}
代码示例来源:origin: rakam-io/rakam
headerRow.setRowStyle(headerSyle);
代码示例来源:origin: org.apache.poi/poi
row.setRowStyle(newStyle);
代码示例来源:origin: stackoverflow.com
while (rows.hasNext()){
Row row1 = rows.next ();
row1.setRowStyle(hiddenstyle);
}
代码示例来源:origin: stackoverflow.com
HSSFWorkbook wb=new HSSFWorkbook();
Row headerRow =sheet.createRow(1);
headerRow.setRowStyle(getCellStyleForColor(wb,new Color(20,20,20));
.....
代码示例来源:origin: stackoverflow.com
CreationHelper createHelper = wb.getCreationHelper();
Sheet sheet = wb.createSheet("new sheet");
Row r = sheet.createRow(0);
r.setRowStyle(rowStyle);
Cell c1 = r.createCell(0);
c1.setCellValue("Test 1");
c1.setCellStyle(rowStyle);
代码示例来源:origin: cn.hutool/hutool-all
/**
* 获取或创建某一行的样式,返回样式后可以设置样式内容
*
* @param y Y坐标,从0计数,既行号
* @return {@link CellStyle}
* @since 4.1.4
*/
public CellStyle getOrCreateRowStyle(int y) {
final Row row = getOrCreateRow(y);
CellStyle rowStyle = row.getRowStyle();
if (null == rowStyle) {
rowStyle = this.workbook.createCellStyle();
row.setRowStyle(rowStyle);
}
return rowStyle;
}
代码示例来源:origin: stackoverflow.com
public static void main(String[] args) throws JDOMException, IOException {
File excelFile = new File("C:/temp/test.xls");
HSSFWorkbook workbook = new HSSFWorkbook();
HSSFSheet sheet = workbook.createSheet("sheetname");
Row r = null;
CellStyle cellStyle = workbook.createCellStyle();
// CreationHelper createHelper = workbook.getCreationHelper();
cellStyle.setDataFormat(workbook.createDataFormat().getFormat("yyyy-MM-dd"));
for (int i = 0; i < 2; i++) {
switch (i) {
case 0:
r = sheet.createRow(0);
r.setRowStyle(cellStyle);
break;
case 1:
r = sheet.createRow(1);
r.setRowStyle(cellStyle);
break;
default:
break;
}
}
try (FileOutputStream out = new FileOutputStream(excelFile)) {
workbook.write(out);
}
Desktop.getDesktop().open(excelFile);
}
代码示例来源:origin: com.gitee.zhaohuihua/zhh-tools
target.setRowStyle(src.getRowStyle());
代码示例来源:origin: micromata/projectforge
style.setShrinkToFit(true);
style.setWrapText(true);
newRow.setRowStyle(style);
代码示例来源:origin: anylogic/alogic
CellStyle cellStyle = sm.getStyle(style);
if (cellStyle != null){
row.setRowStyle(cellStyle);
代码示例来源:origin: hellojavaer/poi-excel-utils
row.setHeight(templateRow.getHeight());
row.setHeightInPoints(templateRow.getHeightInPoints());
row.setRowStyle(templateRow.getRowStyle());
row.setZeroHeight(templateRow.isZeroHeight());
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
row.setRowStyle(newStyle);
内容来源于网络,如有侵权,请联系作者删除!