Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
voidbyname
Frequent Visitor

Export all filtered data or All visuals from Power BI Report Server (On-Permise) to single Excel

Hi expert,
I am deploying pbi dashboard to report server but at the web end I want to export all filtered data from all visuals in a single click not one by one visuals to single excel file. How can I do it. Is there any tool or solution. Please guide on the perspective of On-Permise Server.

I checkout power automate but it not suits my requirements due to on-permise constraint.

Regard Naveed

1 ACCEPTED SOLUTION

Hi @voidbyname ,

You can use Power BI Report Server's APIs to do this. You can use Power BI Report Server's API to retrieve data from a report and export it to JSON or CSV format. You can then use JavaScript to convert the data into an object format and display it on a web page

Here is the C# code:

 

using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

namespace ReportServerAPI
{
    class Program
    {
        static void Main(string[] args)
        {
            RunAsync().Wait();
        }

        static async Task RunAsync()
        {
            using (var client = new HttpClient())
            {
                client.BaseAddress = new Uri("http://localhost:8080/");
                client.DefaultRequestHeaders.Accept.Clear();
                client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

                HttpResponseMessage response = await client.GetAsync("api/reports/1/data?rs:Format=CSV");

                if (response.IsSuccessStatusCode)
                {
                    string data = await response.Content.ReadAsStringAsync();
                    Console.WriteLine(data);
                }
                else
                {
                    Console.WriteLine("Error: " + response.StatusCode);
                }
            }
        }
    }
}

 

Best Regards

Xianda Tang

If this post helps ,then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
josef78
Memorable Member
Memorable Member

On PBI Report Server you can do it only with paginated reports (rdlx)

voidbyname
Frequent Visitor

Thanks @v-xiandat-msft for your response.
I think I need to write my query in more detail. Actually I don't want to export one by one or visual by visual. All I want to do in single click. I just edit the query for better understanding.

Hi @voidbyname ,

You can use Power BI Report Server's APIs to do this. You can use Power BI Report Server's API to retrieve data from a report and export it to JSON or CSV format. You can then use JavaScript to convert the data into an object format and display it on a web page

Here is the C# code:

 

using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

namespace ReportServerAPI
{
    class Program
    {
        static void Main(string[] args)
        {
            RunAsync().Wait();
        }

        static async Task RunAsync()
        {
            using (var client = new HttpClient())
            {
                client.BaseAddress = new Uri("http://localhost:8080/");
                client.DefaultRequestHeaders.Accept.Clear();
                client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

                HttpResponseMessage response = await client.GetAsync("api/reports/1/data?rs:Format=CSV");

                if (response.IsSuccessStatusCode)
                {
                    string data = await response.Content.ReadAsStringAsync();
                    Console.WriteLine(data);
                }
                else
                {
                    Console.WriteLine("Error: " + response.StatusCode);
                }
            }
        }
    }
}

 

Best Regards

Xianda Tang

If this post helps ,then please consider Accept it as the solution to help the other members find it more quickly.

Thanks, I got the idea to do this through your answer.

v-xiandat-msft
Community Support
Community Support

Hi @voidbyname ,

To export all filtered data from all visuals in a single Excel file on an On-Premise Server .You can use the following steps:

Firstly , Open Settings in power bi desktop

vxiandatmsft_0-1706059663121.png

Secondly , Open the report in the Power BI Report Server web portal.

Thirdly , Select the page that contains the visuals you want to export

Forthly, Click on the ‘…’ icon on the upper-right corner of the visual.

Fifthly , Select ‘Export data’ from the visual’s context menu. Choose ‘CSV’ as the file format and click ‘Export’.

vxiandatmsft_2-1706060089544.png

Repeat to export all visual objects to an excel file.

Best Regards,

Xianda Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.