public ActionResult SubExport(string storeId, string checkBatch) { int count = 0; var nl = new System.Collections.Specialized.NameValueCollection() { Request.Params }; //nl.Add("state", "1"); object footer = null; var dt = TakeStockService.ReportList(nl, out count, ref footer, false); if (dt == null || dt.Rows.Count <= 0) { return(RedirectAlert("Report", "暂无数据,请先确认是否已审核!")); } dt.Columns.Add("序号"); dt.Columns.Add("复盘数量"); dt.Columns.Add("盘点员工号"); for (var i = 0; i < dt.Rows.Count; i++) { dt.Rows[i]["序号"] = i + 1; } string[] fields = { "序号", "SureTitle", "SupplierTitle", "CategoryTitle", "Barcode", "Title", "Size", "SubUnit", "SysPrice", "LockNumber", "ActualNumber", "复盘数量", "盘点员工号" }; string[] names = { "序号", "差异确认", "供应商", "品类", "条码", "品名", "规格", "单位", "系统售价", "锁库库存", "盘点数量", "复盘数量", "盘点员工号" }; var totalCols = new int[] { }; var title = ""; new ExportExcel() { IsBufferOutput = true, HeaderText = title }.ToExcel("盘点", dt, fields, names, null, totalCols); return(new EmptyResult()); }
public ActionResult ReportList(string storeId, string checkBatch) { int count = 0; DataTable dt = null; object footer = null; if (!storeId.IsNullOrEmpty() && !checkBatch.IsNullOrEmpty()) { dt = TakeStockService.ReportList(Request.Params, out count, ref footer); } return(ToDataGrid(dt, count, footer)); }