2010-09-07 44 views

回答

1

我承擔ASP版本:

Dim myResponse As HttpResponse = HttpContext.Current.Response 
     Dim strm As System.IO.Stream = New System.IO.MemoryStream 
     Dim strToExport As String 

     OlapGrid.Export(strm) 

     Dim streamReader As New System.IO.StreamReader(strm) 
     strm.Position = 0 
     strToExport = streamReader.ReadToEnd 

     Try 
      myResponse.Clear() 
      myResponse.Buffer = False 
      myResponse.AddHeader("content-disposition", "attachment;filename=Report2Excel.xls") 
      myResponse.ContentEncoding = System.Text.Encoding.Default 
      myResponse.ContentType = "application/vnd.xls" 
      myResponse.Charset = "" 
      myResponse.Write(strToExport) 

     Catch ex As Exception 

     Finally 
      myResponse.[End]() 
     End Try 

順便說一句,如果你知道在網格中的KPI圖像的解決方案讓我知道

+0

THX您的回覆,另外,我得到了它的工作這裏是代碼片段。 (this.IsCallback) {return; – Nathan 2010-09-27 15:44:49

+0

if(this.IsCallback) {return; } Byte [] renderedBytes = _presenter.GetRenderedBytes(new MemoryStream(),OlapClient1);如果(renderedBytes!= null && renderedBytes.Length> 0) {exporting = true; Response.ClearHeaders(); Response.Buffer = true; Response.ContentType =「application/vnd.ms-excel」; // 「應用/ PDF」; Response.AddHeader(「content-disposition」,「attachment; filename = temp.xls」); Response.BinaryWrite(renderedBytes); Response.Flush(); – Nathan 2010-09-27 15:46:15

+0

試試KPI圖片http://documentation.devexpress.com/#WindowsForms/CustomDocument8390http://documentation.devexpress.com/#WindowsForms/CustomDocument8390 – Nathan 2010-09-27 15:55:34

相關問題