protected void btnUpdate_Click(object sender, EventArgs e) { FlyingReport.Refresh(CurrentClub.ID, dateStart.Date, dateEnd.Date, cmbClubMembers.SelectedValue, Convert.ToInt32(cmbClubAircraft.SelectedValue, CultureInfo.InvariantCulture)); btnDownload.Visible = true; Response.Cookies[szCookieLastStart].Value = dateStart.Date.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture); Response.Cookies[szCookieLastEnd].Value = dateEnd.Date.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture); Response.Cookies[szCookieLastStart].Expires = Response.Cookies[szCookieLastEnd].Expires = DateTime.Now.AddYears(5); }
protected void lnkViewKML_Click(object sender, EventArgs e) { DataSourceType dst = DataSourceType.DataSourceTypeFromFileType(DataSourceType.FileType.KML); Response.Clear(); Response.ContentType = dst.Mimetype; Response.AddHeader("Content-Disposition", String.Format(CultureInfo.CurrentCulture, "attachment;filename={0}-AllFlights.{1}", Branding.CurrentBrand.AppName, dst.DefaultExtension)); FlyingReport.WriteKMLToStream(Response.OutputStream, CurrentClub.ID, dateStart.Date, dateEnd.Date, cmbClubMembers.SelectedValue, Convert.ToInt32(cmbClubAircraft.SelectedValue, CultureInfo.InvariantCulture)); Response.End(); }
protected void btnDownload_Click(object sender, EventArgs e) { Response.Clear(); Response.ContentType = "text/csv"; // Give it a name that is the brand name, user's name, and date. Convert spaces to dashes, and then strip out ANYTHING that is not alphanumeric or a dash. string szFilename = String.Format(CultureInfo.InvariantCulture, "{0}-{1}-{2}", Branding.CurrentBrand.AppName, System.Text.RegularExpressions.Regex.Replace(CurrentClub.Name, "[^0-9a-zA-Z-]", string.Empty), DateTime.Now.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture)).Replace(" ", "-"); string szDisposition = String.Format(CultureInfo.InvariantCulture, "inline;filename={0}.csv", System.Text.RegularExpressions.Regex.Replace(szFilename, "[^0-9a-zA-Z-]", string.Empty)); Response.AddHeader("Content-Disposition", szDisposition); FlyingReport.ToStream(Response.OutputStream); Response.End(); }
protected void btnUpdate_Click(object sender, EventArgs e) { FlyingReport.Refresh(CurrentClub.ID, dateStart.Date, dateEnd.Date); btnDownload.Visible = true; }