public async Task Test_Export_Custom_Scale() { var data = new List <ExportScale>(); for (var i = 0; i < 100; i++) { data.Add(new ExportScale { Id = SnowflakeId.CurrentTimeFunc().ToString(), Byte = Conv.ToByte(i), NullableByte = i % 2 == 0 ? null : Conv.ToByteOrNull(i), Short = Conv.ToShort(i), NullableShort = i % 2 == 0 ? null : Conv.ToShortOrNull(i), Int = i, NullableInt = i % 2 == 0 ? null : Conv.ToIntOrNull(i), Long = i, NullableLong = i % 2 == 0 ? null : Conv.ToLongOrNull(i), Float = i * 0.4222222f, NullableFloat = i % 2 == 0 ? null : Conv.ToFloatOrNull(i) * 0.4222222f, Double = i * 0.4222222, NullableDouble = i % 2 == 0 ? null : Conv.ToDoubleOrNull(i) * 0.4222222, Decimal = i * 0.4222222m, NullableDecimal = i % 2 == 0 ? null : Conv.ToDecimalOrNull(i) * 0.4222222m, }); } var bytes = await _excelExportService.ExportAsync(new ExportOptions <ExportScale>() { Data = data, HeaderRowIndex = 0, DataRowStartIndex = 1, }); await File.WriteAllBytesAsync($"D:\\测试导出_{DateTime.Now:yyyyMMddHHmmss}.xlsx", bytes); }