|
|
|
@ -360,7 +360,7 @@ public class ExcelKit {
|
|
|
|
|
public static List<List<String>> getChartData(String docPath, int chartNumber, int skipRowCount) throws IOException, InvalidFormatException, InterruptedException, DocumentException {
|
|
|
|
|
List<List<String>> data = readChart(docPath, chartNumber);
|
|
|
|
|
//需要跳过前skipRowCount行,先要判断一下是不是够跳的,不够跳的直接输出错误
|
|
|
|
|
if (data==null ||data.size() < skipRowCount) {
|
|
|
|
|
if (data == null || data.size() < skipRowCount) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
//截取部分数据返回
|
|
|
|
@ -527,11 +527,10 @@ public class ExcelKit {
|
|
|
|
|
public static List<List<String>> readChart(String sourceDoc, int chartNumber) throws DocumentException, IOException {
|
|
|
|
|
//将word文件解压缩
|
|
|
|
|
UnCompress(sourceDoc);
|
|
|
|
|
|
|
|
|
|
List<List<String>> matrix = new ArrayList<>();
|
|
|
|
|
String xml = DocxUnzipDirectory + "word\\charts\\chart" + chartNumber + ".xml";
|
|
|
|
|
if (!(new File(xml).exists())) {
|
|
|
|
|
System.out.println("没有找到第" + chartNumber + "个图表");
|
|
|
|
|
System.out.println(sourceDoc+"没有找到第" + chartNumber + "个图表");
|
|
|
|
|
return matrix;
|
|
|
|
|
}
|
|
|
|
|
//3、开始读取
|
|
|
|
|