public JsonResult ExportExcel(MonthPayOffExportFilter filter) { string excelPath = this.Server.MapPath(string.Format("/Excel/月结表_{0}.xls", DateTime.Now.ToString("yyyyMMddHHmmss"))); Core.Receivable.MonthPayOff.ExportExcel(excelPath, filter); var result = new { IsSuccess = true, Message = "成功" }; return(Json(result)); }
public static void ExportExcel(string excelPath, MonthPayOffExportFilter filter) { var dataSource = Core.Receivable.MonthPayOff.GetById(filter); List <MonthPayOff> queryData = dataSource.ToList(); var loadBillData = LoadBillReconciliation.GetByMonthPayOffExportFilter(new LBRForMonthPayOffExportFilter() { MonthPayOffIDList = filter.ListID }); List <LoadBillReconciliation> loadBillList = loadBillData.ToList(); GenerateExcel genExcel = new GenerateExcel(); genExcel.SheetList.Add(new MonthPayOffSheet(queryData, "总表")); genExcel.SheetList.Add(new LoadBillSheet(loadBillList, "提单汇总")); genExcel.SheetList.Add(new WayBillSummarySheet(new List <WayBillReconciliation>(), "运单汇总")); genExcel.ExportExcel(excelPath); }
public static IPageOfList <MonthPayOff> GetById(MonthPayOffExportFilter filter) { return(Dao.GetByFilter(filter)); }