You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
3 months ago
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.Module.ExcelModule.Model
{
/// <summary>
/// 按自定义列导出Excel
/// </summary>
public class ExportByColumnReq
{
2 months ago
public string Title { get; set; }
/// <summary>
/// 用户自定义列设置
/// </summary>
public List<UserColumnSet> ColumnSets { get; set; }
/// <summary>
/// Json数据
/// </summary>
public string JsonDataStr { get; set; }
}
3 months ago
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);
}
}
}