tags:

views:

22

answers:

1

I am new to Dundas, I would like to export the olap grid to excell. I dont know how to do it. can someone help me on this?

+1  A: 

I assume the ASP version:

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

BTw if you know a solution for the KPI images in the grid let me know

Doc
Thx for your reply, also, i got it worked here is the code snipt.
Nathan
if (this.IsCallback) {return; }Byte[] renderedBytes = _presenter.GetRenderedBytes(new MemoryStream(), OlapClient1); if (renderedBytes != null Response.ClearHeaders(); Response.Buffer = true; Response.ContentType = "application/vnd.ms-excel"; //"application/pdf"; Response.AddHeader("content-disposition", "attachment; filename=temp.xls"); Response.BinaryWrite(renderedBytes); Response.Flush();
Nathan
Try this for KPI images http://documentation.devexpress.com/#WindowsForms/CustomDocument8390http://documentation.devexpress.com/#WindowsForms/CustomDocument8390
Nathan