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.

Ability to pass Dataset Parameters to an Embedded Paginated Report

have Paginated Reports from SSRS. I opened the .rdl in Power BI Report Builder and Published to the Power BI Service. The reports use Direct Queries and have Dataset Parameters, Not Dataset Filters.

I am testing this with AppOwnsData for .NET Core.

In the Community, they suggested a limited hack, https://community.powerbi.com/t5/Developer/How-do-I-pass-Paginated-Report-Parameters-using-PowerBI/m....

In the Power Bi Playground, I can use the URL Parameter rp, "&rp:Company=ABC", to pass parameter values to the Report.

Using PowerBI-JavaScript, if add the URL Parameter in the config embedURL, "&rp:Company=ABC" is not passed to the Report.

Status: New
Comments
v-lili6-msft
Community Support

hi

"&rp:Company=ABC" should work, please have a look this blog:

https://powerbi.microsoft.com/en-us/blog/embed-paginated-reports-in-your-own-application-for-your-cu...

 

Regards,

Lin

DJBadinN
Regular Visitor

Hi,

 

In my original post I said "Using PowerBI-JavaScript, if add the URL Parameter in the config embedURL, "&rp:Company=ABC" is not passed to the Report."

 

  1. If this isn't a current feature, how do I request it?
DJBadinN
Regular Visitor

I found this link that helped me resolve my problem, Unable to embed paginaged report in Power BI Embed Gen2, thanks sabrina_pbi.

Originally a couple months ago I started with sample code from Microsoft, PowerBI-Developer-Samples / .Net Core / Embed for your customers / AppOwnsData.

Since my discovery, I checked and the AppOwnsData was updated 10 days ago to support Paginated reports by removing the bootstrap implementation, Merged PR 153913: [.Net Core AppOwnsData Sample]: Provide support for… … paginated reports 

MichaelWash
Helper I

In case someone is worndering how you actually pass parameters to an embedded Power BI Paginated report. This code worked for me (to pass: "&rdl:format=CSV&rdl:NoHeader=true&rdl:Encoding=ASCII"):

 

 

    var report = await client.Reports.GetReportInGroupAsync(new Guid(workspaceId), new Guid(reportId));

    // Get the selected report's DatasetID
    GetDatasetForReportResults datasetForReportResult = await GetDatasetForReportAsync(workspaceId, reportId);
    string DatasetID = datasetForReportResult.dataset.Id;

    var generateTokenRequestParameters = new GenerateTokenRequest(
        accessLevel: "view",
        identities: new List<EffectiveIdentity> {
        new EffectiveIdentity(
            username: "user@microsoft.com",
            reports: new List<string> { reportId },
            datasets: new List<string> { DatasetID }
            )}
        );

    var tokenResponse = await client.Reports.GenerateTokenAsync(new Guid(workspaceId), new Guid(reportId), generateTokenRequestParameters);

    result.EmbedToken = tokenResponse;
    result.EmbedUrl = report.EmbedUrl;
    result.Id = report.Id.ToString();

    await Interop.CreateReport(
        JSRuntime,
        PowerBIElement,
        tokenResponse.Token,
        report.EmbedUrl + "&rdl:format=CSV&rdl:NoHeader=true&rdl:Encoding=ASCII",
        report.Id.ToString());

 

 

            showPaginatedReport: function (reportContainer, accessToken, embedUrl, embedReportId) {

                // Get models. models contains enums that can be used.
                var models = window['powerbi-client'].models;

                // Embed configuration used to describe the what and how to embed.
                // This object is used when calling powerbi.embed.
                // This also includes settings and options such as filters.
                // You can find more information at https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details.
                var config = {
                    type: 'report',
                    tokenType: models.TokenType.Embed,
                    accessToken: accessToken,
                    embedUrl: embedUrl,
                    id: embedReportId,
                    permissions: models.Permissions.All,
                    settings: {
                        filterPaneEnabled: true,
                        navContentPaneEnabled: true
                    }
                };

                // Embed the report and display it within the div container.
                powerbi.embed(reportContainer, config);
            }