Skip to content

Instantly share code, notes, and snippets.

View skymilong's full-sized avatar
🤒
cold

sky skymilong

🤒
cold
  • ShangHai
View GitHub Profile
@skymilong
skymilong / poiMerge.java
Last active April 23, 2024 04:31
用于poi操作表格进行同类型的合并单元格计算
private static String[][] convertToMatrix(List<Tdata> dataList, String[] titleRow) throws IllegalArgumentException {
if (dataList.isEmpty()) {
throw new IllegalArgumentException("Data list cannot be empty.");
}
String[][] matrix = new String[dataList.size() + 1][titleRow.length];
System.arraycopy(titleRow, 0, matrix[0], 0, titleRow.length);
for (int i = 0; i < dataList.size(); i++) {
Tdata data = dataList.get(i);