{
// make sure nothing is in response stream
response.Clear();
response.Charset = "";
// set MIME type to be Excel file.
response.ContentType = "application/ms-excel";
// add a header to response to force download (specifying filename)
response.AddHeader("Content-Disposition", "attachment; filename=\"MyFile.xls\"");
for (int i = 0; i < 10; i++)
{
// Send the data. Tab delimited, with newlines.
response.Write("Col1 \t Col2 \t Col3 \t Col4 \n");
}
// Close response stream.
response.End();
}
This comment has been removed by a blog administrator.
ReplyDeletenice thought thank you for sharing
ReplyDeletePhp Developer India