March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi All,
I am trying to read all reports in my group using azure add token authorization. Token comes back good but when I try to execute the power bi API i get below error:
"The requested name is valid, but no data of the requested type was found
Here is my code:
private async Task<string> PostExportRequest(Guid reportId, Guid groupId)
{
try
{
//Export configurations
var paginatedReportExportConfiguration = new PaginatedReportExportConfiguration() { FormatSettings = new Dictionary<string, string>() { { "PageHeight", "14in" }, { "PageWidth", "8.5in" }, { "StartPage", "1" }, { "EndPage", "1" } } };
var exportRequest = new ExportReportRequest { Format = FileFormat.PDF, PaginatedReportConfiguration = paginatedReportExportConfiguration };
//Report and API Urls
var _apiUrl = new Uri("https://analysis.windows.net/powerbi/api/");
var AuthorityUrl = "https://login.microsoftonline.com/consumers/oauth2/v2.0/<tenentid>";
//Credentials
string clientID = "<client id for my azure app>";
string secret = "<secret>";
var credentials = new Microsoft.IdentityModel.Clients.ActiveDirectory.ClientCredential(clientID, secret);
var authenticationContext = new AuthenticationContext(AuthorityUrl);
var authenticationResult = await authenticationContext.AcquireTokenAsync("https://analysis.windows.net/powerbi/api", credentials).ConfigureAwait(false);
var tokenCredentials = new TokenCredentials(authenticationResult.AccessToken, "Bearer");
var pbClient = new PowerBIClient(_apiUrl, tokenCredentials);
// Get a list of Reports inside group.
var reports = await pbClient.Reports.GetReportsInGroupAsync(groupId);
}
catch (Exception ex)
{
}
return null;
}
Has anyone come across this error? Apprecate all the help in advance.
Thanks
Lloyd
Hi @deryl1974,
It seems like you are working with the paginated reports which have been limited usage with the 'get report in group' API. I'd like to suggest you take a look at the official document to know more about these:
Reports - Get Reports In Group - REST API (Power BI Power BI REST APIs) | Microsoft Docs
Note: Paginated reports (rdl) don’t have a dataset. As a result, in the API response for paginated reports, the dataset ID value isn’t displayed.
Regards,
Xiaoxin Sheng
Hi Sheng,
Thank you for your response. However I am getting the same error for power bi reports as well.
Thanks
Lloyd
Hi @deryl1974,
What type of data source do these testing reports use? Connection mode? Please share some more detailed information to help us clarify your scenario and test to reproduce and troubleshoot your issue.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
Hi Xiaoxin,
I am getting error for all of my reports. Connected to datasource or not. For this particular one, I an using below connection:
Data Source: sql server stored procedure.
Connection: on prem sql server (using a data gateway to connect)
Thanks
Lloyd
Hi @deryl1974,
Did these data sources work with import mode or direct query mode? AFAIK, current power bi does not support work with stored procedures in direct query mode. If you are working in this scenario, it may affect the API usages.
Regards,
Xiaoxin Sheng
After looking at the Inner Exception I noticed the following error. Not sure what is causing this:
Message : "The requested name is valid, but no data of the requested type was found." string
NativeErrorCode : 11004
SocketErrorCode : NoData System.Net.Sockets.SocketError
I am not using any data connectivity. Just created test data and populated for testing this scenario.
Any help is higly appreciated.
Thanks
Lloyd
Thanks
Lloyd
Hi @deryl1974,
Please take a look at the following documents about the export report and correspond limitations if they meet your scenarios:
Export Power BI embedded analytics paginated reports API - Power BI | Microsoft Docs
Export Power BI embedded analytics reports API - Power BI | Microsoft Docs
Regards,
Xiaoxin Sheng
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
9 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
10 | |
3 | |
2 | |
2 | |
2 |