Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
645
Export data from a grid within WARP to excel file - How to?
posted

Hi all,

 

I have a grid within a WARP (Web Async Refresh Panel) and want to export the data displayed in grid to an excel file. Exporting process will start after user select toolbar button "Export" on a UltraWebToolbar (please note that the toolbar is also placed within the WARP). Below is the codes I've implemented.

Private Sub tb_ButtonClicked(ByVal sender As Object, ByVal be As Infragistics.WebUI.UltraWebToolbar.ButtonEvent) Handles tb.ButtonClicked
        Select Case be.Button.Key
            Case "Export"
                DoExport()
        End Select

 Private Sub DoExport()
        ExcelExporter.DownloadName = "excel.xls"
        ExcelExporter.Export(grd)
    End Sub

 ExcelExporter is UltraWebGridExcelExporter which is also within WARP.

The problem is after "Export" button selected, WARP shows its progress indicator, but nothing appear after that. I debugged and found that the application passed through "ExcelExporter.Export(grd)" command. If I add a file name argument in Export() method such as "E:\\Output\\excel.xls", the application actually created a file and put it to given folder. But all I want is the exported file will be placed where user designate, not to a hard coded folder. 

I did several researches over the Internet but haven't found a solution for this issue yet. Could you guys help me on this? Thanks in advance.

  • 14049
    Offline posted
    Hi,
    I don't think it is possible to do an export from withing a WARP panel.
    After you click the button the WARP panel expects certain server
    response but instead it gets a binary stream.
    I'd suggest putting the export button outside of the WARP. It will do
    download and the page will not be refreshed since it's not HTML that's
    coming back from the server.