本文整理了Java中org.apache.poi.hssf.usermodel.HSSFWorkbook.createName()
方法的一些代码示例,展示了HSSFWorkbook.createName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HSSFWorkbook.createName()
方法的具体详情如下:
包路径:org.apache.poi.hssf.usermodel.HSSFWorkbook
类名称:HSSFWorkbook
方法名:createName
[英]creates a new named range and add it to the model
[中]创建新的命名范围并将其添加到模型中
代码示例来源:origin: org.apache.poi/poi
@Override
public HSSFName createName() {
return _uBook.createName();
}
代码示例来源:origin: stackoverflow.com
HSSFWorkbook workbook = new HSSFWorkbook();
HSSFSheet realSheet = workbook.createSheet("Sheet xls");
HSSFSheet hidden = workbook.createSheet("hidden");
for (int i = 0, length= countryName.length; i < length; i++) {
String name = countryName[i];
HSSFRow row = hidden.createRow(i);
HSSFCell cell = row.createCell(0);
cell.setCellValue(name);
}
Name namedCell = workbook.createName();
namedCell.setNameName("hidden");
namedCell.setRefersToFormula("hidden!$A$1:$A$" + countryName.length);
DVConstraint constraint = DVConstraint.createFormulaListConstraint("hidden");
CellRangeAddressList addressList = new CellRangeAddressList(0, 0, 0, 0);
HSSFDataValidation validation = new HSSFDataValidation(addressList, constraint);
workbook.setSheetHidden(1, true);
realSheet.addValidationData(validation);
FileOutputStream stream = new FileOutputStream("c:\\range.xls");
workbook.write(stream);
stream.close();
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
@Override
public HSSFName createName() {
return _uBook.createName();
}
内容来源于网络,如有侵权,请联系作者删除!