AlfredoCarnett
New Member
I had problem with export data to .csv file. I use 2 methods.\[code\] Encoding csvEncoding = new UTF8SignatureEncoding(); byte[] csvFile = TestByte(CsvContentDelimiter.NewLine, CsvContentDelimiter.Semicolon, csvEncoding); string attachment = String.Format("attachment; filename={0}.csv", "docs_inv"); Response.Clear(); Response.ClearHeaders(); Response.ClearContent(); Response.ContentType = "text/csv"; Response.ContentEncoding = csvEncoding; Response.AppendHeader("Content-Disposition", attachment); Response.BinaryWrite(csvFile); Response.Flush(); Response.End();\[/code\]And\[code\]public byte[] TestByte(CsvContentDelimiter rowDelimiter, CsvContentDelimiter columnDelimiter, Encoding encoding) { StringBuilder sb = new StringBuilder(); sb.Append("product;"); return encoding.GetBytes(sb.ToString()); }\[/code\]This code create .csv file, but file have bad Encoding and i see only some "hash"