我的代码如下,但是只能做到导出,不能在Excel中显示对应的颜色。  
   
  Response.Clear();    
  Response.BufferOutput=true;    
  Response.Charset="GB2312";          
  Response.AppendHeader("Content-Disposition","attachment;filename=FileName.xls");    
  Response.ContentEncoding=System.Text.Encoding.GetEncoding("GB2312");  
  Response.ContentType   =   "application/ms-excel";    
  DataList1.EnableViewState   =   false;          
  System.Globalization.CultureInfo   myCItrad   =    
                                                          new   System.Globalization.CultureInfo("ZH-CN",true);  
  System.IO.StringWriter   oStringWriter   =   new   System.IO.StringWriter(myCItrad);    
  System.Web.UI.HtmlTextWriter   oHtmlTextWriter   =    
                                        new   System.Web.UI.HtmlTextWriter(oStringWriter);  
  this.DataList1.RenderControl(oHtmlTextWriter);    
  Response.Write(oStringWriter.ToString());  
  Response.End();  
   
  哪位大大指点一下?
6

相关文章:

  • 2022-02-23
  • 2021-07-24
  • 2022-12-23
  • 2021-09-03
  • 2022-03-05
  • 2021-11-02
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-24
  • 2021-07-14
  • 2021-11-30
  • 2021-11-19
  • 2021-12-16
  • 2022-12-23
相关资源
相似解决方案