Aspose.Cells.GridWeb.Examples.CSharp.Miscellaneous.PivotTable.CreateCustomPivotTable.lnkFile_Click C# (CSharp) Méthode

lnkFile_Click() protected méthode

protected lnkFile_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Résultat void
        protected void lnkFile_Click(object sender, EventArgs e)
        {
            // Create path to xls file
            string path = (this.Master as Site).GetDataDir() + "\\Miscellaneous\\";

            // Set filename
            string fileName = "PivotTable.xls";

            // Sents the file to browser.
            Response.ContentType = "application/vnd.ms-excel";
            Response.AddHeader("content-disposition", "attachment; filename=" + fileName);
            Response.WriteFile(path + fileName);
            Response.End();  
        }
    }