读取表格

@param sheetName 表名

@return {@link List}
494253
public static List<List<String>> readTable(String sheetName) {
        setXssfSheet(xssfWorkbook.getSheet(sheetName));
        return readTable();
    }
933130
public static List<String> contentAsList( Iterable<Example> cells )
    {
        return new ArrayList<String>( Arrays.asList( content( cells ) ) );
    }
204053
public Optional<SheetBindingErrors<P>> getBySheetIndex(final int sheetIndex) {
        return list.stream()
                .filter(b -> b.getSheetIndex() == sheetIndex)
                .findFirst();
    }
1292039
public List<HString> group(String groupName) {
    return Collections.unmodifiableList(match.getCaptures().get(groupName));
  }
433533
def __set_sheet_filenames(sheets, n):
    
    try:
        for idx, sheet in enumerate(sheets):
            try:
                sheets[idx]["filename"] = "{}.{}".format(n, sheet["filename"])
            except Exception as e:
                logger_excel.error("set_sheet_filenames: inner: {}".format(e), exc_info=True)
    except Exception as q:
        logger_excel.error("set_sheet_filenames: outer: {}".format(q), exc_info=True)
    return sheets
70041
public XceliteSheet getSheet(String sheetName) {
    Sheet sheet = workbook.getSheet(sheetName);
    if (sheet == null) {
      throw new XceliteException(String.format("Could not find sheet named \"%s\"", sheetName));
    }
    return new XceliteSheetImpl(sheet, file);
  }
917380
public List<String> getValuesList(String name) {
        final List<String> list = new ArrayList<>();
        for (HttpField f : this)
            if (f.getName().equalsIgnoreCase(name))
                list.add(f.getValue());
        return list;
    }
275801
public void processSheet(
            StylesTable styles,
            ReadOnlySharedStringsTable strings,
            SheetContentsHandler sheetHandler,
            InputStream sheetInputStream) throws ReadExcelException {

        DataFormatter formatter = new DataFormatter();
        InputSource sheetSource = new InputSource(sheetInputStream);
        try {
            XMLReader sheetParser = SAXHelper.newXMLReader();
            ContentHandler handler = new XSSFSheetXMLHandlerPlus(
                    styles, null, strings, sheetHandler, formatter, false);
            sheetParser.setContentHandler(handler);
            //开始解析
            sheetParser.parse(sheetSource);
        } catch (ParserConfigurationException e) {
            throw new ReadExcelException("SAX parser appears to be broken - " + e.getMessage());
        } catch (Exception e) {
            throw new ReadExcelException(e.getMessage());
        }
    }
492991
public static int shiftRows(Sheet sheet, List<?> list, int templateRowNum) {
        val itemSize = list == null ? 0 : list.size();
        return shiftRows(sheet, itemSize, templateRowNum);
    }
765386
public static List<?> xls2List(String xmlPath, InputStream inputStream) throws Exception {
        return XlsUtil.xls2List(xmlPath, inputStream);
    }
330846
public <T> boolean write(List<T> list, Class<T> clazz) {
		
		List<Object[]> rows = ExcelBeanHelper.beanToExcelValueArrays(list, clazz);
		try {
			Sheet sheet = workbook.getSheetAt(0);
			for (int i = 2; i < rows.size(); i++) {
				Row excelRow = sheet.getRow(i);
				Object[] vals = rows.get(i);
				for (int j = 0; j < vals.length; j++) {
					Cell cell = excelRow.getCell(j);
					cell.setCellValue(vals[j] == null ? "" : vals[j].toString());
				}
			}
			workbook.write(outputStream);
			return true;
		} catch (IOException e) {
			LOG.error("流异常", e);
		} catch (Exception e) {
			LOG.error("其他异常", e);
		} 
		return false;
	}
1200710
File appendSheet(final List<WorksheetContent> worksheetContents) throws IOException {
        final ImmutableSet<String> worksheetNames = FluentIterable.from(worksheetContents)
                .transform(new Function<WorksheetContent, String>() {
                    @Nullable @Override public String apply(@Nullable final WorksheetContent worksheetContent) {
                        return worksheetContent.getSpec().getSheetName();
                    }
                }).toSet();
        if(worksheetNames.size() < worksheetContents.size()) {
            throw new IllegalArgumentException("Sheet names must have distinct names");
        }
        for (final String worksheetName : worksheetNames) {
            if(worksheetName.length() > 30) {
                throw new IllegalArgumentException(
                        String.format("Sheet name cannot exceed 30 characters (invalid name: '%s')",
                                worksheetName));
            }
        }

        final XSSFWorkbook workbook = new XSSFWorkbook();
        final File tempFile =
                File.createTempFile(ExcelConverter.class.getName(), UUID.randomUUID().toString() + XLSX_SUFFIX);
        final FileOutputStream fos = new FileOutputStream(tempFile);

        for (WorksheetContent worksheetContent : worksheetContents) {
            final WorksheetSpec spec = worksheetContent.getSpec();
            appendSheet(workbook, worksheetContent.getDomainObjects(), spec.getFactory(), spec.getSheetName());
        }
        workbook.write(fos);
        fos.close();
        return tempFile;
    }
358102
public List<String> getScript(String scriptName) {
		String scriptFilename = this.scriptMap.get(scriptName);
		InputStream scriptFileStream = FileUtils.getFileInputStream(scriptFilename);
		
		List<String> sqlList = new SqlScriptReader().getSQLList(scriptFileStream);

		return sqlList;
	}
1315603
public static function sanitize_sheetname($sheetname)
    {
        static $badchars = '\\/?*:[]';
        static $goodchars = '        ';
        $sheetname = strtr($sheetname, $badchars, $goodchars);
        $sheetname = substr($sheetname, 0, 31);
        $sheetname = trim(trim(trim($sheetname), "'"));//trim before and after trimming single quotes
        return !empty($sheetname) ? $sheetname : 'Sheet' . ((rand() % 900) + 100);
    }
843766
function all(sheet, nodes) {
  var result = []
  var length = nodes.length
  var index = -1

  while (++index < length) {
    result.push(visit(sheet, nodes[index]))
  }

  return result.join('')
}
298020
public static List<String> getExpressionsNames(ReportLayout layout) {
		List<String> expressions = new LinkedList<String>();
		for (Band band : layout.getBands()) {
			for (int i = 0, rows = band.getRowCount(); i < rows; i++) {
				List<BandElement> list = band.getRow(i);
				for (BandElement be : list) {
					if (be instanceof ExpressionBandElement) {
						String expName = ((ExpressionBandElement) be).getExpressionName();
						if (!expressions.contains(expName)) {
							expressions.add(expName);
						}
					}
				}
			}
		}
		return expressions;
	}
935436
public WorkbookWriter turnToSheet(@NonNull String name) {
    checkArgument(getAllSheetNames().contains(name), SHEET_NOT_FOUND);
    return turnToSheet(getAllSheetNames().indexOf(name));
  }