Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void ExportReportCSV()
- {
- StringWriter sw = new StringWriter();
- sw.WriteLine(""Reference Number"");
- sw.WriteLine();
- Response.ClearContent();
- Response.AddHeader("content-disposition", "attachment;filename=Report" + DateTime.Now.ToString("yyyyMMddhhmmss") + ".csv");
- Response.ContentType = "application/octet-stream";
- Response.BinaryWrite(Encoding.UTF8.GetPreamble());
- sw.WriteLine(string.Format(""{0}"", "12345SDCRG"));
- Response.Write(sw.ToString());
- Response.End();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement