Excel Export with external RadFilter

2 posts, 0 answers
  1. Fit2Page
    Fit2Page avatar
    372 posts
    Member since:
    Feb 2007

    Posted 24 Jan 2013 Link to this post

    Hi,

    When I export data to Excel from a RadGrid with an external RadFilter, I get all the data instead of the filtered data.

    I use during export:

    Protected Sub Export_Klanten_Click(sender As Object, e As EventArgs) Handles btn_Export_Klanten.Click
     
    RadFilter2.FireApplyCommand()
     
    dtgKlanten.ExportSettings.ExportOnlyData = true     
    dtgKlanten.ExportSettings.IgnorePaging = true
    dtgKlanten.MasterTableView.AllowFilteringByColumn = false
    dtgKlanten.ExportSettings.OpenInNewWindow = true
    dtgKlanten.ExportSettings.HideStructureColumns = true
    dtgKlanten.MasterTableView.ExportToExcel()
    End Sub
     
    Protected Sub RadFilter2_ApplyExpressions(sender As Object, e As RadFilterApplyExpressionsEventArgs)
        Dim provider As New RadFilterSqlQueryProvider()
        provider.ProcessGroup(e.ExpressionRoot)
        dtgKlanten.MasterTableView.FilterExpression = provider.Result
        dtgKlanten.Rebind()
    End Sub

    I thought this would filter the datasource on exporting, but is does not.

    Any suggestions?

    Marc
  2. Fit2Page
    Fit2Page avatar
    372 posts
    Member since:
    Feb 2007

    Posted 24 Jan 2013 Link to this post

    Solved this by using the integrated Excel Export buttons of the RadGrid.
Back to Top