Exporting Arabic data in GridView to Excel -
09-24-2007
, 10:10 AM
I'm using this code to export a gridview containing arabic data to Excel:
System.Web.HttpResponse Response = System.Web.HttpContext.Current.Response;
Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/vnd.ms-excel";
Response.Charset = "";
this.EnableViewState = false;
System.IO.StringWriter oStringWriter = new
System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new
System.Web.UI.HtmlTextWriter(oStringWriter);
grdTransactionsReport.RenderControl(oHtmlTextWrite r);
oHtmlTextWriter.Write("/n");
grdTransactionsReport.RenderControl(oHtmlTextWrite r);
Response.Write(oStringWriter.ToString());
Response.End();
This code is working fine, however the grid columns appear reversed in the
Excel.
i.e. If for instance I have gridview columns with this order:
Column1 Column2 Column3
They appear in this order in Excel:
Column3 Column2 Column1.
Is there a way I can show the columns in the right order.
Thanks
P.S. Headers also has Arabic Text |