protected void DownToExcel_B_Click(object sender, EventArgs e) { OfficeHelper office = new OfficeHelper(); string name = ZType.ToLower().Equals("comment") ? "评论排行.xls" : "点击排行.xls"; SafeC.DownStr(office.ExportExcel(GetDt(), "标题,点击数,评论数,录入者,录入时间"), DateTime.Now.ToString("yyyyMMdd") + "点击排行.xls", Encoding.Default); }
private DataTable GetDt() { DataTable dt = new DataTable(); switch (ZType.ToLower()) { case "comment": dt = countBll.SelRank(NodeID, ModelID, Year, Month, 2); break; default: dt = countBll.SelRank(NodeID, ModelID, Year, Month, 1); break; } return(dt); }