package com.ruoyi.ibs.grid.util;

import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.util.CellRangeAddress;

public class CustExcelUtil {

    public static void fillRow(Sheet sheet, int rowNum, String moduleName, String fieldName, String fieldValue) {
        Row row = sheet.createRow(rowNum);
        row.createCell(0).setCellValue(moduleName);
        row.createCell(1).setCellValue(fieldName);
        row.createCell(2).setCellValue(fieldValue);
    }
    public static void mergeCells(Sheet sheet,int startRow,int endRow,int colum,String moduleName){
        if (moduleName.equals("")){
            return;
        }
        sheet.addMergedRegion(new CellRangeAddress(startRow,endRow,colum,colum));
    }
}
