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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
deryl1974
Frequent Visitor

Error during Get Reports API

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

7 REPLIES 7
Anonymous
Not applicable

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

 

Anonymous
Not applicable

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

 

 

Anonymous
Not applicable

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

 

Anonymous
Not applicable

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.