//导出Excel
protected void BtnMemExcel_Click(objectsender, EventArgs e)
{
Mem bllMember= newMem();int Counts =NetPagerParameter.RecordCount;string strSql =QueryCondition();
strSql+= "and Mem.MemShopID = SysShop.ShopID and Mem.MemLevelID = MemLevel.LevelID and Mem.MemUserID = SysUser.UserID";
strSql+= ("and Mem.MemShopID =SysShopMemLevel.ShopID and SysShopMemLevel.MemLevelID=MemLevel.LevelID");
DataTable db= bllMember.GetListSP(100000, 1, out Counts, PubFunction.GetShopAuthority(_UserShopID, "MemShopID", strSql)).Tables[0];//将数据填充到table中//核心代码
using (ExcelPackage package = newExcelPackage())
{
ExcelWorksheet worksheet= package.Workbook.Worksheets.Add("Sheet");
worksheet.Cells[1, 1].Value = "会员卡号";
worksheet.Cells[1, 2].Value = "会员姓