public ExportExcel ( string data, string fileName ) : void | ||
data | string | |
fileName | string | |
return | void |
public void ExportUserHistory(FormCollection collection) { var userList = MembershipUserExtended.GetFullNameUserNameList(); string userName = collection["uname"]; if (userList.ContainsValue(userName)) { DateTime startDate; DateTime endDate; if (DateTime.TryParse(collection["startDate"], out startDate) && DateTime.TryParse(collection["endDate"], out endDate)) { var model = TimeTrackManager.GetUserTimeTrackHistoryForSpecifiedPeriod(userName, startDate, endDate); //return PartialView("_GetUserHistory", model); IExportPage export = new ExportPage(); var reportName = model.EmployeeName.Replace(" ", "_") + "_" + model.CustomStartEndDateDisplay.Replace(" ", "-"); export.ExportExcel(ExcelReportHelper.GetExcelString(model,reportName), reportName + ".xls"); } } //return PartialView("_GetUserHistory", new CustomTimeTrack()); }