本文整理匯總了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);
}