Is it possible to add “Auto Filter” in SSRS reports exported Excel Output file?

╄→гoц情女王★ 提交于 2019-12-02 07:42:28
Amit

I am trying to figure out how to do this as well. So far I have the following VBA to add an auto-filter to all sheets on row 1:

Sub FilterLoop()
    Dim WS_Count As Integer
    Dim I As Integer
    WS_Count = ActiveWorkbook.Worksheets.Count
    For I = 1 To WS_Count
        ActiveWorkbook.Worksheets(I).Select
        Range("A1").AutoFilter
    Next I
    ActiveWorkbook.Worksheets(1).Select
End Sub

It is less than ideal, but I have added this to my PERSONAL workbook so that I can just run it when I generate a new report. I hope this helps, and if I figure out something better, I'll post again.

I had the same issue too and I think it is not possible.

The Excel export is primarily a layout renderer. It replicates the layout of the rendered report as closely as possible. There are differences and different limitations in Excel, so not everything is working. The AutoFilter is not supported, you cannot add it automatically to the exported file.

Excel does not support interactive sort either.

https://docs.microsoft.com/en-us/sql/reporting-services/report-builder/exporting-to-microsoft-excel-report-builder-and-ssrs#a-nameinteractivitya-interactivity

In my case, I have to open the generated file in c# and add the filter there.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!