1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
protected void EExcel_Click(object sender, System.EventArgs e)
{
// Set the content type to Excel.
Response.ContentType = "application/vnd.ms-excel";
// Remove the charset from the Content-Type header.
Response.Charset = "";
// Turn off the view state.
this.EnableViewState = false;
remplirtableauventilation();
System.IO.StringWriter tw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
// Get the HTML for the control.
tblventilation.RenderControl(hw);
Response.Write("<?xml version=1.0 encoding=utf-8?><html><body>");
// Write the HTML back to the browser.
Response.Write(tw.ToString);
Response.Write("</body></html>");
// End the response.
Response.End();
} |
Partager