2010-09-07 88 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

相关问题