本文整理汇总了C#中OfficeOpenXml.ExcelPackage.AddSheet方法的典型用法代码示例。如果您正苦于以下问题:C# ExcelPackage.AddSheet方法的具体用法?C# ExcelPackage.AddSheet怎么用?C# ExcelPackage.AddSheet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OfficeOpenXml.ExcelPackage
的用法示例。
在下文中一共展示了ExcelPackage.AddSheet方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DonorTotalSummary
public EpplusResult DonorTotalSummary(DonorTotalSummaryOptionsModel m)
{
var ep = new ExcelPackage();
var cn = new SqlConnection(Util.ConnectionString);
var rd = cn.ExecuteReader("dbo.DonorTotalSummary", DonorTotalSummaryParameters(m, useMedianMin: true), commandType: CommandType.StoredProcedure, commandTimeout: 1200);
ep.AddSheet(rd, "MemberNon");
rd = cn.ExecuteReader("dbo.DonorTotalSummaryBySize", DonorTotalSummaryParameters(m), commandType: CommandType.StoredProcedure, commandTimeout: 1200);
ep.AddSheet(rd, "BySize");
rd = cn.ExecuteReader("dbo.DonorTotalSummaryByAge", DonorTotalSummaryParameters(m), commandType: CommandType.StoredProcedure, commandTimeout: 1200);
ep.AddSheet(rd, "ByAge");
return new EpplusResult(ep, "DonorTotalSummary.xlsx");
}
示例2: ToExcelBytes
public static byte[] ToExcelBytes(this IDataReader rd, string filename = null, bool useTable = false)
{
var dt = new DataTable();
dt.Load(rd);
var ep = new ExcelPackage();
ep.AddSheet(dt, filename, useTable);
return ep.GetAsByteArray();
}
示例3: PledgeFulfillment2
public EpplusResult PledgeFulfillment2(int fundid1, int fundid2)
{
var ep = new ExcelPackage();
var cn = new SqlConnection(Util.ConnectionString);
cn.Open();
var rd = cn.ExecuteReader("dbo.PledgeFulfillment2", new { fundid1, fundid2, },
commandTimeout: 1200, commandType: CommandType.StoredProcedure);
ep.AddSheet(rd, "Pledges");
return new EpplusResult(ep, "PledgeFulfillment2.xlsx");
}
示例4: ToExcel
public static EpplusResult ToExcel(this DataTable dt, string filename = "People.xlsx", bool useTable = false)
{
var ep = new ExcelPackage();
ep.AddSheet(dt, filename, useTable);
return new EpplusResult(ep, filename);
}