private void btnExportToCSV_Click(object sender, EventArgs e) { if (Page.IsValid) { int identityId = Convert.ToInt32(cboClient.SelectedValue); DateTime start = dteStartDate.SelectedDate.Value; start = start.Subtract(start.TimeOfDay); DateTime end = dteEndDate.SelectedDate.Value; end = end.Subtract(end.TimeOfDay).Add(new TimeSpan(23, 59, 59)); Facade.IJob facJob = new Facade.Job(); DataSet dsCallInSheet = null; //dsCallInSheet = facJob.GetDailyLogExportCSV(identityId, start, end); dsCallInSheet = facJob.GetCallInSheetForClient(identityId, start, end, chkShowLatesOnly.Checked); Session["__ExportDS"] = dsCallInSheet.Tables[0]; Server.Transfer("../Reports/csvexport.aspx?filename=DailyLogExport.csv"); } }
private DataSet GetData() { DateTime start = dteStartDate.SelectedDate.Value; start = start.Subtract(start.TimeOfDay); DateTime end = dteEndDate.SelectedDate.Value; end = end.Subtract(end.TimeOfDay).Add(new TimeSpan(23, 59, 59)); int identityId = Convert.ToInt32(cboClient.SelectedValue); Facade.Job facJob = new Facade.Job(); DataSet dsCallInSheet = null; dsCallInSheet = facJob.GetCallInSheetForClient(identityId, start, end, chkShowLatesOnly.Checked); return(dsCallInSheet); }