using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DS.Module.ExcelModule.Model { /// /// 按自定义列导出Excel /// public class ExportByColumnReq { public string Title { get; set; } /// /// 用户自定义列设置 /// public List ColumnSets { get; set; } /// /// Json数据 /// public string JsonDataStr { get; set; } } public class exceldt { public DataTable dt { get; set; } private int x偏差 = 0; private int y偏差 = -1; public exceldt(DataTable dt, bool NoTitile = false) { this.dt = dt; if (NoTitile == true) { y偏差 = 0; } } public string getValue(int y, int x) { DataRow dr = dt.Rows[y - 1 + y偏差]; return dr[x - 1 + x偏差].ToString(); } public decimal? getdecimal(int y, int x) { var str = getValue(y, x); if (string.IsNullOrWhiteSpace(str)) return null; return decimal.Parse(str); } } }