Forum Discussion

otexugo's avatar
otexugo
Regular Visitor
1 year ago
Solved

Export embedded report with filters

Hey, everyone!

 

I have an embedded report where the user can click on a point in the chart and/or select which data will be used in the sidebar "Filters". When I try to export the report to PDF with the filters applied, it doesn't work. My client makes a request to my API, which in turn makes the request to the PowerBI API on the route `v1.0/myorg/groups/${groupId}/reports/${reportId}/ExportTo`.

 

I tried to find a solution, but I'm a bit lost on what to do. When retrieving the filters applied to the report, I get filters like:

 

[
    {
        "$schema": "http://powerbi.com/product/schema#basic",
        "target":
        {
            "table": "companies",
            "column": "status"
        },
        "filterType": 1,
        "displaySettings":
        {
            "displayName": "Company Status"
        },
        "operator": "In",
        "values":
        [
            "active"
        ],
        "requireSingleSelection": false
    },
    {
        "$schema": "http://powerbi.com/product/schema#basic",
        "target":
        {
            "table": "companies",
            "column": "size"
        },
        "operator": "In",
        "values":
        [
            "500-1000"
        ]
    }
]

 

The first one was obtained through the `getFilters` method of the report. The second one I build from the dataPoints obtained from the click on the chart.

 

Is there any way to pass these filters to export the report as a PDF?