Quantcast
Channel: All Developer posts
Viewing all 48640 articles
Browse latest View live

Re: Custom Visual : Properties (Color picker)

$
0
0

Hi -.

 

I have that method in my code:

 

    private static parseSettings(dataView: DataView): VisualSettings {
        return VisualSettings.parse(dataView) as VisualSettings;
    }

Also the enumerate object instances method:

    public enumerateObjectInstances(options: EnumerateVisualObjectInstancesOptions): VisualObjectInstance[] {
        let objectName: string = options.objectName;
        let objectEnumeration: VisualObjectInstance[] = [];
        switch( objectName ) {
            case 'colorPicker':
                objectEnumeration.push({
                    objectName: objectName,
                    properties: {
                        "firstColor":{
                            "type": {
                                "fill": {
                                    "solid": {
                                        "color": this.viewModel.minColor
                                    }
                                }
                            }
                        },
                        "secondColor":{
                            "type": {
                                "fill": {
                                    "solid": {
                                        "color": this.viewModel.midColor
                                    }
                                }
                            }
                        },
                        "thirdColor":{
                            "type": {
                                "fill": {
                                    "solid": {
                                        "color": this.viewModel.maxColor
                                    }
                                }
                            }
                        }
                    },
                    selector: null
                });
                break;
        };
        return objectEnumeration;
    }

And at the beginnning of my visualTransform method (takes VisualUpdateOptions and updates the viewmodel):

 

    public visualTransform(options: VisualUpdateOptions){

        this.viewModel = {
            dataPoints: [],
            dataIndex: {},
            dataMin: 0,
            dataMax: 1,
            highlighted: true,
            categoryName: '',
            minColor: this.settings.colorPicker.firstColor,
            midColor: this.settings.colorPicker.secondColor,
            maxColor: this.settings.colorPicker.thirdColor
        };

more code

And my objects element in capabilites json:

 

 "objects": {
        "colorPicker": {
            "displayName": "Gradient",
            "properties": {
                "firstColor":{
                    "displayName" : "Min value",
                    "type": {
                        "fill": {
                            "solid": {
                                "color": true
                            }
                        }
                    }
                },
                "secondColor":{
                    "displayName" : "Mid value",
                    "type": {
                        "fill": {
                            "solid": {
                                "color": true
                            }
                        }
                    }
                },
                "thirdColor":{
                    "displayName" : "Max value",
                    "type": {
                        "fill": {
                            "solid": {
                                "color": true
                            }
                        }
                    }
                }
            }
        }
    }

Basically, I can use the three color pickers and the visual gets updated with the selected color... but the app updates the color to gray in the selector (it does display the selected color for a bit amount of time, and the switches back to gray).

 

My version of API is 2.6.0.

 

Thanks for your help


Re: Custom Visual : Properties (Color picker)

$
0
0

Hi ,

 

Do you call the parseSettingsalso in the updatemethod?

 

The enumerateObjectInstances is only called when the formatting pane is used and not by the main code of the visual.

And the configured state of the formatting pane is being stored in the options.dataViewobject that is a parameter of the updatemethod. That is why you have to parse the settings from the dataView in the update method as each change in the formatting pane will trigger that method.

 

-JP

Re: Custom Visual : Properties (Color picker)

$
0
0

Hi  , 

 

firstly thanks for your prompt response Smiley Happy

 

Here goes my update method. Second line is the call to visual.parseSettings.

 

    public update(options: VisualUpdateOptions) {
        let self = this;
        self.settings = Visual.parseSettings(options && options.dataViews && options.dataViews[0]);        
        self.visualTransform(options);
        self.svg.selectAll('path').each(self.updateHandler());
        self.fitSVGtoViewPort(options.viewport.width, options.viewport.height);
    }

Could it be related with the fact that selector is null when declaring the objectEnumeration?

 

Regards

Jorge

Re: Custom Visual : Properties (Color picker)

$
0
0

Hi  ,

 

Looks like the colors are 'static' and not related to any data, so you can keep you enumerateObjectInstancesmethod pretty simple like this:

public enumerateObjectInstances(options: EnumerateVisualObjectInstancesOptions): VisualObjectInstanceEnumeration {
    const settings: VisualSettings = this.visualSettings || VisualSettings.getDefault() as VisualSettings;
    return VisualSettings.enumerateObjectInstances(settings, options);
}

And define in your VisualSettings the default colors of your three colors. Probably you have to set them in the format #RRGGBB to let enerything work.

 

-JP

Re: Custom Visual : Properties (Color picker)

$
0
0

Hi

 

It worked Smiley Happy I can confirm after replacing the code now the selector is working as expected.

 

Thanks very much for your support

 

Jorge

Get data from Infor Olap Cubes into Power BI

$
0
0

Very interested in seeing this happen, any users with experience in achieving this yet?

A simple post and get request would do the job i would imagine, but how would you retain the hierarchy structure?

Also has anyone managed to get Infor data connected via 'SQL Server Analysis Services Database'?

 

Appreciate its a few questions, any help is appreciated Smiley Happy

Re: Is there any way to stop "Microsoft Power BI" and the url from being added to a prin

$
0
0

Thanks Daniel, but this is for my customers and the print function is being called using the api function report.print(), so this wouldn't work. What I'm looking for is if there is a way during the call the stop those headers from being added.

Re: Is there any way to stop "Microsoft Power BI" and the url from being added to a prin

$
0
0

Hmmm... I've had a look at print() and its doc states that it's invoking window.print(), which is pretty much browser-specific, and has no additional parameters available to it.

I've done some research (read: furious Googling and experimenting with answers) on what can be done when working with this method, and there doesn't seem to be much that can be done about it. A lot of these articles suggest using a CSS Media Query, but I couldn't find an example that really worked.

The best I could find was this answer on StackOverflow - it's from a while ago but there is still some recently discussion on it so you may have some success - this answer from last year suggests that you might get somewhere with using modern Chrome/Firefox.

I'll have to tap-out at this point, but hopefully this might help.

Regards,

Daniel


Re: radial gauge color

$
0
0

Hi  

 

In case you haven't see it yet. Here is a tutorial on how to make the Gauge color dynamic.

 

https://youtu.be/_JMSw6i5pzY

 

This feature is almost brand new. From the June Power BI update.

 

You first create a measure with 'Switch' statement to get the desired color depending on the conditions you need. and then you use this measure in the format tap as show in the following image.

Capture.PNG

 

I hope this will help.

 

 

secure embed power BI report

$
0
0

Hi All,

I'm facing a problem when using secure embed fonction for my powerBI report 

Capture_2.PNG

the html link works well but the iframe code given by the function return :

<Error>
<Code>ResourceNotFound</Code>
<Message>
The specified resource does not exist. RequestId:855c550c-a01e-0065-57be-58c935000000 Time:2019-08-22T07:54:35.4614052Z
</Message>
</Error>
 
NB: it seems that they changed recently the iframe source from the app.powerbi.com to app.blob.core.windows.net
could someone have an answer
Thanks
 

Re: custom visual enumeration issues

$
0
0

hi  , and how you add dynamic data to combo box?

 

i try all step above and my combo box still show the static data from capabily file

 

this is my visual.ts

visual.ts.01.PNG

 

and this is my browser console loglog.ts.01.PNG

Re: Unable to see Power bi data set in power bi service

PBI Embedded RLS Error: Creating embed token with multiple identities is not supported

$
0
0

Hi everyone,

 

I am developing an App Owns Data web application in Python - Django. It's all working fine, but now I am trying to add Row Level Security to it, as mentioned in the docs from Power BI: https://docs.microsoft.com/en-us/power-bi/developer/embedded-row-level-security.

 

I used the same example pbix and in Power BI desktop the roles are working, also the report is embedded just fine without RLS. However, when I add the identities payload to the request the REST API gives me the following error message as the response:

 

b'{"error":{"code":"InvalidRequest","message":"Creating embed token with multiple identities is not supported"}}'

 

The simplified python code that is working looks like this:

PBI Embedded Error.png

 

If I comment out the identities it gives me the embed token as usual. 

 

Any ideas why I'm getting this error? 

Help would be greatly appreciated!

 

Regards.

Re: custom visual enumeration issues

$
0
0

hi  ,

 

when dev my custom visual this option is not possible.

I make a combobox dinamic into CV in CSS.

 

hope is help you.

get data from sharepoint folder/link using python script

$
0
0

I need to have a new script in Power BI and let it read all files that I have inside this folder. How can I do that? What is folder in sharepoint?

The most simple code to do this task:

 

import pandas as pd

 

# data loading and processing
path = "C:\\Users\\elnksa\\Documents\\Projects\\GWO_AGT\\dataset.csv"
dataset = pd.read_csv(path)

 

However I am not sure how to do that for sharepoint.


Uncertified custom visual in embedded?

$
0
0

Hi guys,

 

I'm kinda new to the topic of creating your own custom visuals. While reading through the official documentation I found this: "Certified custom visuals can be added to the Power BI service, a Power BI Desktop report, and viewed with Power BI mobile and Power BI Embedded".
My intention was to use my custom visual in an embedded report in a web application I'm developing, so does this mean I won't be able to use my own custom visual in an embedded report without having it certified beforehand?
I really hope you guys can help me out with this. Thanks in advance!

Re: Uncertified custom visual in embedded?

$
0
0

So is your plan to add your custom visual to the gallery of custom visuals or are you just generating the pbiviz file locally and going to import that into a report?

Re: get data from sharepoint folder/link using python script

Re: Uncertified custom visual in embedded?

$
0
0

Thank you for the quick reply! My plan was to generate the pbviz file locally and import it that way.

Re: Sliding legend

$
0
0

 ,

 

Hi again,

How can I make sliding legend for visual with table dataview mapping? 

I got error at identity, using getSelectionIds.

Regards,

Yerkhan

Viewing all 48640 articles
Browse latest View live


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