rt

解决方案 »

  1.   

    你到MSDN上去查SpreadsheetClass这个吧
      

  2.   

    http://www.eggheadcafe.com/articles/20021220.asp
      

  3.   

    怎么样出现Add Reference 对话框?
    解决后马上给分!
      

  4.   

    Private Sub ExportDataGrid(FileType As String,FileName As String)
         Response.Charset="GB2312"
     Response.ContentEncoding=System.Text.Encoding.GetEncoding("GB2312")
     Response.AppendHeader("Content-Disposition", "attachment;filename=" & HttpUtility.UrlEncode(FileName, System.Text.Encoding.UTF8))  Response.ContentType=FileType
     Me.EnableViewState=False
     Dim tw As System.IO.StringWriter
     tw=new System.IO.StringWriter()
     Dim hw As System.Web.UI.HtmlTextWriter
     hw=new HtmlTextWriter(tw)
     DataGrid1.RenderControl(hw)
     Response.Write(tw.ToString)
     Response.End()
    End Sub
        Sub Export_Excel_Click(ByVal Sender As Object, ByVal e As EventArgs)
        ExportDataGrid("application/ms-excel","abc.xls")
        End Sub