类 ExcelUtil
java.lang.Object
org.anyline.poi.excel.ExcelUtil
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static booleanexport(File file, int rows, Collection<?> set, String... configs) 导出excelstatic booleanexport(File file, int rows, List<String> keys, Collection<?> set) 导出EXCELstatic boolean导出EXCELstatic booleanstatic booleanexport(File template, File file, int insert, Collection<?> set, String... configs) 导出excelstatic boolean导出EXCELstatic booleanexport(File template, File file, int rows, List<String> headers, List<String> keys, Collection<?> set) 导出EXCELstatic booleanstatic boolean导出excelstatic booleanexport(File template, File file, String sheet, int insert, List<String> headers, List<String> keys, Collection<?> set) 导出EXCELstatic booleanstatic booleanexport(File template, File file, Collection<?> set, String... configs) 导出excelstatic boolean导出EXCELstatic boolean导出EXCELstatic booleanstatic booleanexport(File template, OutputStream os, int insert, Collection<?> set, String... configs) static booleanexport(File template, OutputStream os, int insert, List<String> keys, Collection<?> set) static booleanexport(File template, OutputStream os, int rows, List<String> headers, List<String> keys, Collection<?> set) static booleanexport(File template, OutputStream os, int insert, org.anyline.entity.html.Table table) static booleanexport(File template, OutputStream os, String sheet, int insert, Collection<?> set, String... configs) static booleanexport(File template, OutputStream os, String sheet, int insert, List<String> headers, List<String> keys, Collection<?> set) static booleanexport(File template, OutputStream os, String sheet, int insert, org.anyline.entity.html.Table table) static booleanexport(File template, OutputStream os, Collection<?> set, String... configs) static booleanexport(File template, OutputStream os, List<String> keys, Collection<?> set) static booleanexport(File template, OutputStream os, List<String> headers, List<String> keys, Collection<?> set) static booleanexport(File template, OutputStream os, org.anyline.entity.html.Table table) static booleanexport(File file, String sheet, int rows, Collection<?> set, String... configs) 导出excelstatic booleanexport(File file, String sheet, int insert, List<String> headers, List<String> keys, Collection<?> set) static booleanstatic booleanstatic booleanexport(File file, Collection<?> set, String... configs) 导出excelstatic booleanexport(File file, List<String> keys, Collection<?> set) 导出EXCELstatic boolean导出EXCELstatic booleanstatic booleanexport(OutputStream os, int rows, Collection<?> set, String... configs) static booleanexport(OutputStream os, int rows, List<String> keys, Collection<?> set) static booleanexport(OutputStream os, int rows, List<String> headers, List<String> keys, Collection<?> set) static booleanexport(OutputStream os, String sheet, int rows, Collection<?> set, String... configs) static booleanexport(OutputStream os, String sheet, int insert, List<String> headers, List<String> keys, Collection<?> set) 导出EXCELstatic booleanexport(OutputStream os, String sheet, int insert, org.anyline.entity.html.Table table) static booleanexport(OutputStream os, Collection<?> set, String... configs) static booleanexport(OutputStream os, List<String> keys, Collection<?> set) static booleanexport(OutputStream os, List<String> headers, List<String> keys, Collection<?> set) static StringgetMergedRegionValue(org.apache.poi.ss.usermodel.Sheet sheet, int row, int col) 获取合并单元格的值static org.apache.poi.ss.usermodel.WorkbookgetWorkbook(File file) static org.apache.poi.ss.usermodel.Workbookstatic booleanisMerged(org.apache.poi.ss.usermodel.Sheet sheet, int row, int col) 判断指定的单元格是否是合并单元格static booleanmerge(org.apache.poi.ss.usermodel.Sheet sheet, int firstRow, int lastRow, int firstCol, int lastCol) static int[]static int[]static int[]static int[]static int[]static int[]position(InputStream is, int sheet, int rows, int cols, String regex) 根据内容(正则)定位单元格static int[]position(InputStream is, int sheet, String regex) static int[]position(InputStream is, String regex) static int[]position(InputStream is, String sheet, int rows, int cols, String regex) static int[]position(InputStream is, String sheet, String regex) static int[]读取excel读取指定Sheet也的内容读取指定Sheet也的内容读取指定Sheet也的内容读取excel读取excel读取excelread(InputStream is) read(InputStream is, int sheet) read(InputStream is, int sheet, int rows) 读取指定Sheet也的内容read(InputStream is, int sheet, int rows, int foot) read(InputStream is, String sheet) read(InputStream is, String sheet, int rows) read(InputStream is, String sheet, int rows, int foot) read(org.apache.poi.ss.usermodel.Sheet sheet, int start, int end) 读取sheetstatic Stringstatic voidstatic voidstatic voidstatic Stringstatic voidstatic voidstatic voidstatic Stringvalue(InputStream is, int row, int col) static Stringvalue(InputStream is, int sheet, int row, int col) static Stringvalue(InputStream is, String sheet, int row, int col) static voidstatic Stringstatic voidstatic voidstatic voidstatic voidstatic voidstatic voidstatic voidstatic Stringvalue(org.apache.poi.ss.usermodel.Cell cell) static Stringvalue(org.apache.poi.ss.usermodel.Sheet sheet, int row, int col) static voidvalue(org.apache.poi.ss.usermodel.Sheet sheet, int row, int col, double value) static voidvalue(org.apache.poi.ss.usermodel.Sheet sheet, int row, int col, int value) static voidstatic Stringvalue(org.apache.poi.ss.usermodel.Workbook workbook, int sheet, int row, int col) static String读取1行数据values(InputStream is, int row) values(InputStream is, int sheet, int row) values(InputStream is, String sheet, int row) values(org.apache.poi.ss.usermodel.Sheet sheet, int row)
-
字段详细资料
-
OFFICE_EXCEL_XLS
- 另请参阅:
-
OFFICE_EXCEL_XLSX
- 另请参阅:
-
-
构造器详细资料
-
ExcelUtil
public ExcelUtil()
-
-
方法详细资料
-
read
读取指定Sheet也的内容- 参数:
file- file 文件sheet- sheet序号,从0开始rows- 从第几行开始读取foot- 到第几行结束(如果负数表示 表尾有多少行不需要读取)- 返回:
- List
-
read
读取指定Sheet也的内容- 参数:
file- file 文件sheet- sheet序号,从0开始rows- 从第几行开始读取- 返回:
- List
-
position
public static int[] position(org.apache.poi.ss.usermodel.Sheet sheet, int rows, int cols, String regex) -
position
根据内容(正则)定位单元格- 参数:
is- 文件sheet- sheetrows- 开始行cols- 开始列regex- 匹配内容- 返回:
- int[]
-
position
-
position
-
position
-
position
-
position
-
position
-
position
-
position
-
position
-
read
读取指定Sheet也的内容- 参数:
is- 输入流sheet- sheet序号,从0开始rows- 从第几行开始读取- 返回:
- List
-
read
-
read
读取指定Sheet也的内容- 参数:
file- file 文件sheet- sheet序号,从0开始- 返回:
- List
-
read
-
read
读取excel- 参数:
file- 文件 第0个sheet第0行开始读取- 返回:
- list
-
read
-
read
读取excel- 参数:
file- 文件sheet- sheetrows- 从rows行开始读取- 返回:
- list
-
read
读取excel- 参数:
file- 文件sheet- sheetrows- 从rows行开始读取foot- 到第几行结束(如果负数表示 表尾有多少行不需要读取)- 返回:
- list
-
read
-
read
-
read
读取excel- 参数:
file- 文件sheet- sheet- 返回:
- list
-
read
-
getWorkbook
public static org.apache.poi.ss.usermodel.Workbook getWorkbook(File file) throws org.apache.poi.EncryptedDocumentException, org.apache.poi.openxml4j.exceptions.InvalidFormatException, IOException - 抛出:
org.apache.poi.EncryptedDocumentExceptionorg.apache.poi.openxml4j.exceptions.InvalidFormatExceptionIOException
-
getWorkbook
public static org.apache.poi.ss.usermodel.Workbook getWorkbook(InputStream is) throws org.apache.poi.EncryptedDocumentException, org.apache.poi.openxml4j.exceptions.InvalidFormatException, IOException - 抛出:
org.apache.poi.EncryptedDocumentExceptionorg.apache.poi.openxml4j.exceptions.InvalidFormatExceptionIOException
-
read
读取sheet- 参数:
sheet- sheetstart- 从第rows行开始end- 到第几行结束(如果负数表示 表尾有多少行不需要读取)- 返回:
- List
-
isMerged
public static boolean isMerged(org.apache.poi.ss.usermodel.Sheet sheet, int row, int col) 判断指定的单元格是否是合并单元格- 参数:
sheet- sheetrow- 行下标col- 列下标- 返回:
- boolean
-
getMergedRegionValue
public static String getMergedRegionValue(org.apache.poi.ss.usermodel.Sheet sheet, int row, int col) 获取合并单元格的值- 参数:
sheet- sheetrow- rowcol- col- 返回:
- String
-
values
读取1行数据- 参数:
file- 文件sheet- sheetrow- 行- 返回:
- List
-
values
-
values
-
values
-
values
-
values
-
values
-
values
-
values
-
values
-
value
-
value
-
value
public static String value(org.apache.poi.ss.usermodel.Workbook workbook, int sheet, int row, int col) -
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
-
value
public static void value(org.apache.poi.ss.usermodel.Sheet sheet, int row, int col, double value) -
value
public static void value(org.apache.poi.ss.usermodel.Sheet sheet, int row, int col, int value) -
value
-
export
public static boolean export(OutputStream os, String sheet, int insert, List<String> headers, List<String> keys, Collection<?> set) 导出EXCEL- 参数:
os- 输出流sheet- sheetinsert- 导出的开始位置headers- 表头 headers 表头keys- 对应列名属性名 keys 对应列名属性名set- 数据源 set 数据源- 返回:
- boolean
-
export
-
export
-
export
-
export
public static boolean export(File template, OutputStream os, String sheet, int insert, org.anyline.entity.html.Table table) -
export
-
export
-
export
-
export
public static boolean export(OutputStream os, String sheet, int insert, org.anyline.entity.html.Table table) -
export
public static boolean export(File file, int rows, List<String> headers, List<String> keys, Collection<?> set) 导出EXCEL- 参数:
file- 导致文件位置,如果文件已存存,则以当前文件作为模板rows- 开始写入的行数headers- 表头keys- 读取集合条目的属性set- 数据集合- 返回:
- boolean
-
export
public static boolean export(OutputStream os, int rows, List<String> headers, List<String> keys, Collection<?> set) -
export
导出EXCEL- 参数:
file- 导致文件位置,如果文件已存存,则以当前文件作为模板keys- 读取集合条目的属性set- 数据集合- 返回:
- boolean
-
export
-
export
导出EXCEL- 参数:
file- 导致文件位置,如果文件已存存,则以当前文件作为模板headers- 表头keys- 读取集合条目的属性set- 数据集合- 返回:
- boolean
-
export
public static boolean export(OutputStream os, List<String> headers, List<String> keys, Collection<?> set) -
export
导出EXCEL- 参数:
file- 导致文件位置,如果文件已存存,则以当前文件作为模板rows- 从第几行开始写入keys- 读取集合条目的属性set- 数据集合- 返回:
- boolean
-
export
-
export
public static boolean export(File file, String sheet, int rows, Collection<?> set, String... configs) 导出excel- 参数:
file- 导致文件位置,如果文件已存存,则以当前文件作为模板sheet- sheet 如果文件存在 并且为空时 则取第0个sheetrows- 行数set- 数据configs- 姓名:NAME或NAME- 返回:
- boolean
-
export
public static boolean export(OutputStream os, String sheet, int rows, Collection<?> set, String... configs) -
export
导出excel- 参数:
file- 导致文件位置,如果文件已存存,则以当前文件作为模板rows- 行数set- 数据configs- 姓名:NAME或NAME- 返回:
- boolean
-
export
-
export
导出excel- 参数:
file- 导致文件位置,如果文件已存存,则以当前文件作为模板set- 数据configs- 姓名:NAME或NAME- 返回:
- boolean
-
export
-
export
public static boolean export(File template, File file, String sheet, int insert, List<String> headers, List<String> keys, Collection<?> set) 导出EXCEL- 参数:
template- 模板file- 导致文件位置sheet- sheetinsert- 导出的开始位置headers- 表头 headers 表头keys- 对应列名属性名 keys 对应列名属性名set- 数据源 set 数据源- 返回:
- boolean
-
export
-
export
public static boolean export(File template, OutputStream os, String sheet, int insert, List<String> headers, List<String> keys, Collection<?> set) -
export
public static boolean export(File template, File file, int rows, List<String> headers, List<String> keys, Collection<?> set) 导出EXCEL- 参数:
template- templatefile- 导致文件位置,如果文件已存存,则以当前文件作为模板rows- 开始写入的行数headers- 表头keys- 读取集合条目的属性set- 数据集合- 返回:
- boolean
-
export
public static boolean export(File template, OutputStream os, int rows, List<String> headers, List<String> keys, Collection<?> set) -
export
导出EXCEL- 参数:
template- templatefile- 导致文件位置,如果文件已存存,则以当前文件作为模板keys- 读取集合条目的属性set- 数据集合- 返回:
- boolean
-
export
-
export
public static boolean export(File template, File file, List<String> headers, List<String> keys, Collection<?> set) 导出EXCEL- 参数:
template- templatefile- 导致文件位置,如果文件已存存,则以当前文件作为模板headers- 表头keys- 读取集合条目的属性set- 数据集合- 返回:
- boolean
-
export
public static boolean export(File template, OutputStream os, List<String> headers, List<String> keys, Collection<?> set) -
export
public static boolean export(File template, File file, int insert, List<String> keys, Collection<?> set) 导出EXCEL- 参数:
template- templatefile- 导致文件位置,如果文件已存存,则以当前文件作为模板insert- 从第几行开始写入keys- 读取集合条目的属性set- 数据集合- 返回:
- boolean
-
export
public static boolean export(File template, OutputStream os, int insert, List<String> keys, Collection<?> set) -
export
public static boolean export(File template, File file, String sheet, int rows, Collection<?> set, String... configs) 导出excel- 参数:
template- templatefile- 导致文件位置,如果文件已存存,则以当前文件作为模板sheet- sheet 如果文件存在 并且为空时 则取第0个sheetrows- 行数set- 数据configs- 姓名:NAME或NAME- 返回:
- boolean
-
export
public static boolean export(File template, OutputStream os, String sheet, int insert, Collection<?> set, String... configs) -
export
public static boolean export(File template, File file, int insert, Collection<?> set, String... configs) 导出excel- 参数:
template- templatefile- 导致文件位置,如果文件已存存,则以当前文件作为模板insert- 开始插入的位置set- 数据configs- 姓名:NAME或NAME- 返回:
- boolean
-
export
-
export
public static boolean export(File template, OutputStream os, int insert, Collection<?> set, String... configs) -
export
public static boolean export(File template, OutputStream os, int insert, org.anyline.entity.html.Table table) -
export
导出excel- 参数:
template- templatefile- 导致文件位置,如果文件已存存,则以当前文件作为模板set- 数据configs- 姓名:NAME或NAME- 返回:
- boolean
-
export
-
export
-
merge
public static boolean merge(org.apache.poi.ss.usermodel.Sheet sheet, int firstRow, int lastRow, int firstCol, int lastCol)
-