Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
tarunbajaj@gmail.com #1
Exporting to Excel with Chinese Characters
Hello all,
I am using the code below the DataGrid to Excel but my Chinese
characters are not converted most of the time.
The data otherwise display the chars correctly in chinese.
I am not able to find a concrete solution for this.
This code works alright with English
Thanks for help
private void ShowReport( DataTable pResult )
{
dgResult.DataSource = pResult;
dgResult.DataBind();
//create the filename
string strName = REPORT_FILENAME;
strName = strName +
Convert.ToString(DateTime.Now.ToShortDateString()) ;
strName = strName.Replace('/', '_');
strName = strName + ".xls";
//strName = strName + ".csv";
Response.Clear();
Response.Buffer= true;
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("Content-Disposition", "attachment;filename=" +
strName);
Response.Charset = "UTF-8";
this.EnableViewState = true;
System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new
System.Web.UI.HtmlTextWriter(oStringWriter);
dgResult.RenderControl(oHtmlTextWriter);
Response.Write(oStringWriter.ToString());
Response.End();
} //end of ShowReport()
tarunbajaj@gmail.com Guest
-
How to display Chinese characters under a datagrid?
I have an HTTPService that returns XML encoded under gb2312. Displaying the XML under the browser shows, correctly, all the Chinese characters.... -
HTML Editor for Chinese Characters?? Help!
Is there a free/cheap HTML editor out there that a colleague of mine in China can use to view Chinese characters while editing an HTML page? I can... -
Handling special characters when exporting DataGrid to Excel
I am trying to export a DataGrid to Excel using a HtmlTextWriter and the DataGrid.RenderControl method. Everything is working fine except that... -
Chinese characters
I installed Informix on English version Windows XP (Professional). I set the XP's regional settings to "Chinese PRC" and environment variables:... -
WebForm contain Chinese characters...
Hello, My WebForm(*.aspx) contain Chinese characters. When I put them to the web server with Chinese OS, they look fine. But when I put them to...



Reply With Quote

