Myworld
Myworld

Reputation: 1899

export gridview to excel sheet

I had soluation to export gridview rows to excel sheet .I did that well but when I opened the excel sheet the language which in gridview apeared whit unkown language as this(الجيزة) this is arabic language .So please any one help me

Upvotes: 0

Views: 1346

Answers (2)

Serkan Hekimoglu
Serkan Hekimoglu

Reputation: 4284

If your question is like my comment, and if you have different regional setting (not enUS) this should be culture info problem. I can suggest you to use a trick like this

CultureInfo oldCulture = Thread.CurrentThread.CurrentCulture;
        Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");

//Fill your excel sheet in this part, and return old culture

Thread.CurrentThread.CurrentCulture = oldCulture;

Upvotes: 1

Tim Schmelter
Tim Schmelter

Reputation: 460238

Have a look at this example, maybe it solves your encoding issue.

Response.ContentEncoding = Encoding.Unicode;
Response.BinaryWrite(Encoding.Unicode.GetPreamble());

Upvotes: 1

Related Questions