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.
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
Solved! Go to 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.
On PBI Report Server you can do it only with paginated reports (rdlx)
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.
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
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’.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
9 | |
8 | |
4 | |
2 | |
2 |