Open 1059183326 opened 1 year ago
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import java.util.ArrayList;
import java.util.List;
public class ExcelWriterExample {
public static void main(String[] args) {
// Your data list
List<List<Object>> data = new ArrayList<>();
// Initialize EasyExcel writer
ExcelWriter excelWriter = EasyExcel.write("output.xlsx").build();
// Initialize write sheet
WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").build();
// Register your custom cell write handler
CustomCellWriteHandler customCellWriteHandler = new CustomCellWriteHandler();
// Attach the custom cell write handler to the write sheet
writeSheet.setCustomWriteHandler(customCellWriteHandler);
// Write data to the excel file
excelWriter.write(data, writeSheet);
// Close the writer
excelWriter.finish();
}
}
问题描述
重写方法后,用registerwritehandler运用,但仍显示 0 usages 没有被运用