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
simplyamitshah
New Member

RDLC Power BI report export using Power BI API - export with filter fails

SSRS RDLC report is uploaded to Pwoer BI. I am trying to export the report using Power BI API. Without any paginatedreportconfiguration, it works fine, successfully exports in XLSX format whole report.

If I specify any filters like below then Polling method shows status as failed. Unable to get exact exception.

var exportId = await PostExportRequest(reportId, groupId, format, pageNames, urlFilter);
if (exportId != "-1")
{
do
{
var httpMessage = await PollExportRequest(reportId, groupId, exportId, pollingtimeOutInMinutes, token);
export = httpMessage.Body;

------------------------------------

//Filter configuration

using var PaginatedReportConfiguration = new PaginatedReportExportConfiguration()
{
FormatSettings = formatsettings,
ParameterValues = new ParameterValue[] {
 new ParameterValue { Name = "SAPCompanyCode", Value = "1001"}
}
};

 

RDLC report DataSet properties -> Parameters shows ParameterName and ParameterValue with exact name -

SAPCompanySAPCompanyCode

 

1 ACCEPTED SOLUTION
simplyamitshah
New Member

Problem resolved after passing correct values. In RDLC report data source is Tabular cube s the values should be in exact format of cube columns not just string.

For example - 

new ParameterValue { Name = "SAPCompanySAPCompanyCode", Value = "[SAP Company].[SAP Company Code].&[1010]"},

new ParameterValue { Name = "StandardAccountClass", Value = "[Account].[Sub Class].&[Total stockholders' equity]"},

 

Trick was to open the Power BI report in browser and checked the network traces after applying filter. Traces will show /render POST call and body will have all parameters values. thanks to PowerBI API team who helped me in troubleshooting the issue. 

View solution in original post

3 REPLIES 3
simplyamitshah
New Member

Problem resolved after passing correct values. In RDLC report data source is Tabular cube s the values should be in exact format of cube columns not just string.

For example - 

new ParameterValue { Name = "SAPCompanySAPCompanyCode", Value = "[SAP Company].[SAP Company Code].&[1010]"},

new ParameterValue { Name = "StandardAccountClass", Value = "[Account].[Sub Class].&[Total stockholders' equity]"},

 

Trick was to open the Power BI report in browser and checked the network traces after applying filter. Traces will show /render POST call and body will have all parameters values. thanks to PowerBI API team who helped me in troubleshooting the issue. 

v-shex-msft
Community Support
Community Support

Hi @simplyamitshah,

Did this parameter defined in your paginated report correctly? I'd like to suggest you double check these part settings to confirm if they can be invoked in the rest API:

Create parameters for paginated reports in the Power BI service - Power BI | Microsoft Docs

BTW, can you please share some more detail about your scenario? (e.g. report data source, connection, parameters settings...) They will help us clarify your scenario and test to troubleshoot:

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

simplyamitshah_0-1658122263864.png

Below are the parameters. I checked all the parameters and passed parameters which are not having any default values means it will expect value from parameter query. Below is the latest code. Not passing FormatSettings and Identities. 

var PaginatedReportConfiguration = new PaginatedReportExportConfiguration()
{
//FormatSettings = formatsettings,
//ParameterValues = parameterValues
ParameterValues = new ParameterValue[] {
new ParameterValue { Name = "SAPCompanySAPCompanyCode", Value = "1001"},
new ParameterValue { Name = "Month", Value = "March, 2022"},
new ParameterValue { Name = "CurrencyTypeCurrencyType", Value = "Statutory"},
new ParameterValue { Name = "QOQMonth", Value = "March, 2022"},
new ParameterValue { Name = "YOYMonth", Value = "March, 2022"},
new ParameterValue { Name = "SelectedMonth", Value = "March, 2022"},
new ParameterValue { Name = "StandardAccountClass", Value = "Expenses"},
new ParameterValue { Name = "StandardAccountSubClass", Value = "Billed Revenue"},
new ParameterValue { Name = "StandardAccountLineItem", Value = "Accounts payable"},
new ParameterValue { Name = "StandardAccountLineItemDetail", Value = "Accounts payable"}

}

 

var exportRequest = new ExportReportRequest
{
Format = FileFormat.XLSX,
//PowerBIReportConfiguration = powerBIReportExportConfiguration//,
PaginatedReportConfiguration = PaginatedReportConfiguration
};
//,
//Identities = new List<EffectiveIdentity> {
// new EffectiveIdentity { Username = "" },
//}
};

simplyamitshah_1-1658122307112.png

 

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.