Excel 下拉選單
public void GenerateWithValidation<T>(string TemplatePath, string ReportPath, List<T> entities, int Offset, int PageSize) { using (FileStream fileStream = new FileStream(TemplatePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) { IWorkbook workbook = WorkbookFactory.Create(fileStream); ISheet sheet = workbook.GetSheetAt(0); List<ICell> TemplateCells = new List<ICell>(); for (int i = 0; i < sheet.GetRow(Offset).Cells.Count; i++) { TemplateCells.Add(sheet.GetRow(Offset).GetCell(i)); } PropertyInfo[] properties = typeof(T).GetProperties(); foreach (var entity in entities) { sheet.CreateRow(Offset); int CellInRow = 0; foreach (var property in properties) { ICell cell = sheet.GetRow(Offset).CreateCell(CellInRow); cell.CellStyle = TemplateCells[CellInRow].CellStyle; cel...