Quantcast
Channel: Developer topics
Viewing all 17958 articles
Browse latest View live

Set datasource credentials programmatically

$
0
0

We are building an ISV application that uses Power BI embedding for rendering of Power BI reports.  This application will be distributed to client sites and each will have different database logins (username/password) for all their reports.

 

We need a way to programmatically (and securely) set these datasource credentials at runtime when a user attempts to run the report.  These credentials cannot be appended as parameters to the URL or other insecure methods.

 

Does anyone have a method for doing this dynamically in C#?  Your help is much appreciated.

Ronny


{Operation returned an invalid status code 'Forbidden} while executing ExportToFileInGroupAsync

$
0
0

I am trying to export a power BI report in my custom application.

I added a button, and on that button click, i am executing this code.

 

var url = XXX;
var content = new Dictionary<string, string>();
content["grant_type"] = "XXX";
content["resource"] = "XXX";
content["username"] = XXX;
content["password"] = XXX;
content["client_id"] = XXX;

var response = await APIHelper.MakeAsyncRequest(url, content);
var tokenresult = response.Content.ReadAsStringAsync().Result;
var OAuthResultModel = JsonConvert.DeserializeObject<OAuthResultModel>(tokenresult);
var authenticationResult = OAuthResultModel;

var credentials = new TokenCredentials(authenticationResult.AccessToken, "Bearer");
var client = new PowerBIClient(credentials);
var reportsResult = await client.Reports.ExportToFileInGroupAsync(GroupID, ReportID, exportRequest);

 

 

when code execute the last line , the error occured.

saadashraf_0-1593587074025.png

 

 

Operation returned an invalid status code 'Forbidden while executing ExportToFileInGroupAsync

$
0
0

https://docs.microsoft.com/en-us/power-bi/developer/embedded/export-to

 

By using the above document link, i tried to export a power bi report from an application using this code in .net core framework.


var powerBIReportExportConfiguration = new PowerBIReportExportConfiguration
{
Settings = new ExportReportSettings
{
Locale = "en-us",
},
Pages = pageNames?.Select(pn => new ExportReportPage(pageName = pn)).ToList(),
};
var exportRequest = new ExportReportRequest
{
Format = format,
PowerBIReportConfiguration = powerBIReportExportConfiguration,
};

 

var url = XXX;
var content = new Dictionary<string, string>();
content["grant_type"] = "XXX";
content["resource"] = "XXX";
content["username"] = XXX;
content["password"] = XXX;
content["client_id"] = XXX;

var response = await APIHelper.MakeAsyncRequest(url, content);
var tokenresult = response.Content.ReadAsStringAsync().Result;
var OAuthResultModel = JsonConvert.DeserializeObject<OAuthResultModel>(tokenresult);
var authenticationResult = OAuthResultModel;

var credentials = new TokenCredentials(authenticationResult.AccessToken, "Bearer");
var client = new PowerBIClient(credentials);
var reportsResult = await client.Reports.ExportToFileInGroupAsync(GroupID, ReportID, exportRequest);

While executing the last line, code break and through an exception, i.e.:

 

{"Operation returned an invalid status code 'Forbidden"}

Install-Module -Name MicrosoftPowerBIMgmt error

$
0
0

Hi,

 

powershell 5.1 version

 

getting an error below when try install Install-Module -Name MicrosoftPowerBIMgmt.

 

powerbi_error.png

If try 

 

> GET-PSRepository
WARNING: Unable to find module repositories.

 

How can we resolve.

 

Machine not connected to internet thus not sure if we need to do something different to get this installed and what?

 

When installs does it connect to internet to download?

 

Thanks

 

 

 

 

PBI Rest API - Create datasource in gateway error

$
0
0

Hi, everyone

 

I hope someone can help me. I'm trying to create a datasource in a gateway using PBI Rest API and it shows an error. The body I'm using is the one that is in documentation.

 

Body

{ "dataSourceType": "SQL", "connectionDetails": "{\"server\":\"MyServer\",\"database\":\"MyDatabase\"}", "datasourceName": "Sample Datasource", "credentialDetails": { "credentialType": "Windows", "credentials": "AB....EF==", "encryptedConnection": "Encrypted", "encryptionAlgorithm": "RSA-OAEP", "privacyLevel": "None" } }

Response

{ "error": { "code": "DM_GWPipeline_UnknownError", "pbi.error": { "code": "DM_GWPipeline_UnknownError", "parameters": {}, "details": [ { "code": "DM_ErrorDetailNameCode_UnderlyingErrorMessage", "detail": { "type": 1, "value": "Invalid Ciphertext size. Expecting cipher text of atleast length, 344. Provided cipherText length, 10" } }, { "code": "DM_ErrorDetailNameCode_UnderlyingHResult", "detail": { "type": 1, "value": "-2146233296" } } ], "exceptionCulprit": 1 } } }

 

Any tip?... 

 

Thanks in advance,

Scroll Bar Color & Option to Turn Off Numerical Results Next to Filter Options

$
0
0

Does anyone know if it is possible to darken the color of the scroll bar inside a filter drop-down? Also, is there a way to remove or turn off the numbers next to the filter options?

scroll bar.png

 

numerical results in filter.png 

Access calculated table in multiple reports

$
0
0

Hi People,

 

Currently I'm struggling with the problem of repeating calculated tables in multiple reports.

I have used a few datasets from a SQL sever and Excel files to calculate the final dataset, which is used for the visualisations in different reports.

So dataset A + dataset B + dataset C are used to calculate the final dataset D and the final dataset D is necessary to make some visualisations in different reports.

The final dataset D is calculated with DAX / calculated tables.

However, I have to copy those dataset scripts and the calculated table inclusive the DAX measures for every report. This is a very time consuming process and results in a high risk for errors.

Does somebody know an altenative to calculate the final dataset D only once and access that dataset in multiple reports?

Thank you in advance!

streaming datasets powershell for tenant usage

$
0
0

Hi,

 

Getting error message at line 78 when have followed the steps in 

Assuming domain is just <companyname.com>?

 

Anyone knwo how to resolve this?

 

Thanks

 

https://www.proserveit.com/blog/power-bi-usage-metrics-across-all-workspaces

and used powershell

https://github.com/ssugar/Blog/blob/master/PowerBIUsage/Scripts/Get-PowerBIUsage.ps1

 

Invoke-RestMethod : The remote server returned an error: (404) Not Found.
At C:\pbi_pshell\Get-PowerBIUsage.ps1:78 char:21
+ ... $response = Invoke-RestMethod -Method Post -Uri "$powerBiEndpoint" -B ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand


Creating New Reports

$
0
0

When I create a new report I create a duplicate of an existing report file and then change the DSN.  The reason is because this existing report is the template I use.  Is there a better practise? 

 

Also, and more importantly right now, with my current method, i keep getting a 'ODBC: ERROR [08001] FATAL: Too many connections for role'.  Do you think this is due to the my duplicate method?

 

Thanks.

Cmdlet/PBI Rest API for update/create App

$
0
0

Hi everyone

 

Does anyone know if there is a cmdlet o PBI Rest API to create or update a workspace APP?.

 

I have found some commands to get the APP, but not to create or update.

 

Thanks in advance,

 

 

 

Export reports as image files tenant setting

$
0
0

In the Power BI code sample for Exporting files (https://docs.microsoft.com/en-us/power-bi/developer/embedded/export-to#code-examples)  it says below that you need to enabled the export reports as image files.  I have admin and looking in the tenant and I dont see an image for below.  I have Power BI Premium so I should be able to do it.  Does anyone know where this setting is at?

Before using the API, verify that the following admin tenant settings are enabled:

  • Export reports as PowerPoint presentations or PDF documents - Enabled by default.
  • Export reports as image files - Required only for .png and disabled by default.

SQL Server Stored Procedure with Data Parameters (Enter Date Parameters before Query Refresh)

$
0
0

I have a stored procedure that asks for dates before running the query.  Is there a way to have a query run inside PowerBI and before it actually runs asks for specific date parameters?  Issue is the data size.  We dont want them running a large query and the date will be changing daily.  Basically want to see if BI can have parameters like SSRS before a query runs.  Any info would be helpful.  

embedded javascript in paginated reports

$
0
0

Is it possible to embed javascript in Power BI Paginated Reports?  

 

I've tried adding a reference to system.web but of course it fails when I attempt to deploy to the Power BI Service.

 

TIA

graph for different projects ,teams and then monthwise data

$
0
0

hi all

 

I need to create a graph based on the data.i have a data which consists of different projects with monthwise data and then each project consists of different teams and also same data we can divide into different teams and each team shows up again the monthwise data.

so which graph can i use in power bi and how can i drill down project to different teams and then when i click on one team and need to show up the month wise data for that team.

 

can anyone please help me

 

Thanks in advance

App Access Requests Automation

$
0
0

Hi, Is there anyway to automate the approve process for PowerBI App access requests that we receive via email.

We are on PowerBI Premium and we keep getting tons of requests from users to access the APP So ideally want to route the email to Business Owner of that app and then with his/her approval via email shall trigger auto grant access to PowerBI App?

Is it possible via PowerAutomate, PowerShell(REST APIs) ?

Thanks, ANS


Powerbi on load Shimmer

$
0
0

Hi Team,

 

We are working with integration of powerbi component in our react application. We were thinking if we could use powerbi starting shimmer which comes before it actually loads. 

Is there any npm package or library which we can use to have this. 

Any help would be really appreciated.

 

Thanks,

Arpit

404 - "PowerBIEntityNotFound" - issues getting embed token

$
0
0

Hi there, I'm trying to get te embed token to make some proves on playground.

once i have my prooves on rails the back end will connect with appi and passme accessToken to consume de pbio APIREST from my react app(wich i couldn't connect withouth a anoying popup). we are using app owns data approach.

My route:

 

1: get mi groups bi RESTAPI: get groups

2: get mi reports so i can get report id: get dashboards in group 

3: additional get mi daataset id in case that i'll need it: get dataset in group

throught here, everithing is okay.

4: get my embed token to playground my dashboards, and make react proves: reports generate token in groups

 

my body query:

 

{ "accessLevel": "View", "identities": [ { "username": "User",(i'd tryied everything) "roles": [ "sales"(tryied everything: Owner, Administrator, cliente:pbi desktop report config) ], "datasets": [ "my_data_set_id" ] } ] }

 

 

through this process i get an 404 error "PowerBIEntityNotFound". i can not figure out where can i get my user an role that i need, or why i need it i have not data level acces to config. The error:

 

 

{ "error": { "code": "PowerBIEntityNotFound", "pbi.error": { "code": "PowerBIEntityNotFound", "parameters": {}, "details": [], "exceptionCulprit": 1 } } }

 



my path:

get pbi pro lisence and an azure app to apps own data approach

get pbi service on azure to add capacities to my worspaces on app.powerbi.com(creat a user to admin it)

set capacities on my workspaces, now seeing an diamond on it.

have azure paid services

 

Need help with the API

$
0
0

Hello Everyone,

 

I've a doubt as mentioned below - 

 

Is there an API or another way to recover the list of users having access to applications? Those users are not members in the workspace. I know there's a way to do this via Power Shell but I would be be great if there's an API based solution.

 

Any help would be really appreciated.

 

Thanks & Warm Regards,

Harsh

CORS Error On CesiumJS Custom Visual

$
0
0

I'm trying to develop a CesiumJS custom visual, but I can't even get it to display the globe.

Every time I start it I get multiple CORS errors:

iGCarroll_0-1593698459130.png

 

Anotación 2020-07-02 110723.png

Anotación 2020-07-02 1107223.png

It seems like it tries to load some assets and create some workers, but app.powerbi.com doesn't allow it. A lot of the different error messages follow this pattern:

"Access to XMLHttpRequest at <some CesiumJS file> from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource"

 

I modified my webpack.config.js following all the steps in here and it looks like this now:

 

const path = require("path"); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const config = require("../config.json"); const TerserPlugin = require("terser-webpack-plugin"); const webpack = require('webpack'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const cesiumSource = 'node_modules/cesium/Source'; const cesiumWorkers = '../Build/Cesium/Workers'; module.exports = { entry: { 'visual.js': ['./src/visual.ts'] }, devtool: 'source-map', mode: "production", optimization: { minimizer: [ new TerserPlugin({ cache: true, parallel: true, sourceMap: true, terserOptions: {} }) ], minimize: false, concatenateModules: false }, performance: { maxEntrypointSize: 1024000, maxAssetSize: 1024000, hints: false }, module: { rules: [ { parser: { amd: false } }, { test: /\.json$/, loader: require.resolve('json-loader'), type: "javascript/auto" }, { test: /(\.less)|(\.css)$/, use: [ { loader: MiniCssExtractPlugin.loader }, { loader: require.resolve('css-loader') }, { loader: require.resolve('less-loader'), options: { paths: [path.resolve(__dirname, "..", 'node_modules')] } } ] }, { test: /\.(woff|ttf|ico|woff2|jpg|jpeg|png|webp|gif|svg|eot)$/i, use: [ { loader: require.resolve('base64-inline-loader') } ] } ], unknownContextCritical: false }, externals: { "powerbi-visuals-api": 'null', "fakeDefine": 'false', "corePowerbiObject": "Function('return this.powerbi')()", "realWindow": "Function('return this')()" }, resolve: { extensions: ['.tsx', '.ts', '.jsx', '.js', '.css'], }, output: { path: null, publicPath: 'assets', filename: "[name]", sourcePrefix: '' }, amd: { toUrlUndefined: true }, node: { fs: 'empty' }, devServer: { disableHostCheck: true, contentBase: null, compress: true, port: 8080, hot: false, inline: false, https: true, headers: { "access-control-allow-origin": "*", "cache-control": "public, max-age=0" } }, plugins: [ new MiniCssExtractPlugin({ filename: config.build.css, chunkFilename: "[id].css" }), new CopyWebpackPlugin([ { from: path.join(cesiumSource, cesiumWorkers), to: 'Workers' } ]), new CopyWebpackPlugin([ { from: path.join(cesiumSource, 'Assets'), to: 'Assets' } ]), new CopyWebpackPlugin([ { from: path.join(cesiumSource, 'Widgets'), to: 'Widgets' } ]), new webpack.DefinePlugin({ CESIUM_BASE_URL: JSON.stringify('') }) ] };

 

 

My visual.ts looks like this:

 

"use strict"; import "core-js/stable"; import "./../style/visual.less"; import powerbi from "powerbi-visuals-api"; import VisualConstructorOptions = powerbi.extensibility.visual.VisualConstructorOptions; import VisualUpdateOptions = powerbi.extensibility.visual.VisualUpdateOptions; import IVisual = powerbi.extensibility.visual.IVisual; import EnumerateVisualObjectInstancesOptions = powerbi.EnumerateVisualObjectInstancesOptions; import VisualObjectInstance = powerbi.VisualObjectInstance; import DataView = powerbi.DataView; import VisualObjectInstanceEnumerationObject = powerbi.VisualObjectInstanceEnumerationObject; import { VisualSettings } from "./settings"; import { Viewer, Ion } from 'cesium'; import "cesium/Build/Cesium/Widgets/widgets.css"; export class Visual implements IVisual { private target: HTMLElement; private container: HTMLDivElement; private settings: VisualSettings; constructor(options: VisualConstructorOptions) { this.target = options.element; } public update(options: VisualUpdateOptions) { let target = this.target; let container = this.container; let settings = this.settings; settings = Visual.parseSettings(options && options.dataViews && options.dataViews[0]); container = document.createElement("div"); container.id = "cesiumContainer"; target.appendChild(container); Ion.defaultAccessToken = '<myAccessToken>'; var viewer = new Viewer('cesiumContainer'); } private static parseSettings(dataView: DataView): VisualSettings { return <VisualSettings>VisualSettings.parse(dataView); } public enumerateObjectInstances(options: EnumerateVisualObjectInstancesOptions): VisualObjectInstance[] | VisualObjectInstanceEnumerationObject { return VisualSettings.enumerateObjectInstances(this.settings || VisualSettings.getDefault(), options); } }

 

Does anyone know a solution for this?

 

Thanks in advance!

Trying to submit a Power BI Custom Visual but receiving email-error on pbivizsubmit@microsoft.com

$
0
0

Hi,

 

I am trying to submit our Power Bi custom visual to get it published in the AppSource.

However when sending the email with the pbix and the pbiviz file to pbivizsubmit@microsoft.com to get the app-package I do receive the following error:

Screenshot 2020-07-02 at 17.22.43.png

 

Can anyone tell me what address we need to use to sent the data to get the app-package.

 

I have done this several times already and never had this problem.

 

Regards

 

Paul

 

Viewing all 17958 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>