public class ExportTByNPOI { [STAThread] public static void ExportTDataByNPOI(List dataList,string fileName) { if(dataList!=null && dataList.Any()) { var firstData = dataList.FirstOrDefault(); var props = firstData.GetType().GetProperties().Where(x => !x.GetMethod.IsVirtual).ToList(); XSSFWorkbook workbook = new XSSFWorkbook(); ISheet firstSheet = workbook.CreateSheet("First Sheet"); IRow firstRow = firstSheet.CreateRow(0); for(int i=0;i