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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
cmholden
Regular Visitor

Custom Visual Dialog Sizing in Desktop

I have created a Custom Visual that uses Modal Dialogs. A  sample of the code used to open the dialog is shown below.

 

The issue is that the dialog sizes correctly in Power BI online, but is always 100px (I think) high in Desktop(V 2.100.785.0 ). No matter what value I use neither the 'top' nor the 'height' ever change. Exactly the same code and settings always show correctly in Power BI online.

Is this a bug - or is there a difference between Desktop and online for this option?

 

const position:powerbi.extensibility.visual.VisualDialogPosition = {
            type: powerbi.VisualDialogPositionType.RelativeToVisual,
            left: 20,
            top: 0
        };
        const size:powerbi.extensibility.visual.RectSize = {width: 450, height: 525};
               
        const dialogOptions:powerbi.extensibility.visual.DialogOpenOptions = {
            actionButtons: this.helpDlgButtons,
            size: size,
            position:  position,
            title: `My DIalog`
        };
       
        this.visualHost.openModalDialog(PopupDlg.id, dialogOptions, retrievedSettings)........
1 ACCEPTED SOLUTION

No, the machine easily fulfills all those requirements and there is still the issue.

I will accept as a solution, but I think there is a problem with Macs running Windows which I don't really understand.

View solution in original post

9 REPLIES 9
cmholden
Regular Visitor

Thanks for the reply again.

I cannot get this to show properly on a Mac running Windows 10 and have not yet been able to get hold of a purely Windows machine (they are all dual boot Macs). So I don't know if this issue has been resolved. 

 

Have you any idea why this should be the case? It seems strange to me that no matter what the resolution, the popup shows correctly in the online version but not on Desktop. Is the source code very different between the two? 

Hi @cmholden ,

I'm not sure what's the cause of problem... Please check if your computer meets the following minimum requirements to run Power BI Desktop.

yingyinr_0-1641461346744.png

Also check out the documentation below, hopefully it will help you troubleshoot and solve the problem.

Considerations and limitations

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

No, the machine easily fulfills all those requirements and there is still the issue.

I will accept as a solution, but I think there is a problem with Macs running Windows which I don't really understand.

cmholden
Regular Visitor

I just noticed that the image I sent you for Desktop is for the Help popup not the edit as shown in the Online screen shot. However, this is not important as the popup looks exactly the same in Desktop for the Edit popup i.e the height and top location are ignored and the width and left are accepted.

v-yiruan-msft
Community Support
Community Support

Hi @cmholden ,

According to your description, it seems that the dialog box can display the set size in Power BI Service, but not in the Power BI Desktop. How is the dialog box displayed in Power BI Desktop and Power BI Service respectively? Could you please provide some screenshots of them if it is convenient? Before sharing, please mask off the sensitive information. Thank you.

In addition, you can refer the following documentation to create a dialog box for the visual...

Define the size and position of the dialog box

export interface RectSize {
        width: number;
        height: number;
    }

    export interface DialogOpenOptions {
        title: string;
        size?: RectSize;
        position?: VisualDialogPosition;
        actionButtons: DialogAction[];
    }

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for the reply!

The code sample I gave is pretty much the same as the sample you gave me from the docs.

As you can see, the dialog is crunched right at the top of the screen in Desktop and is correctly presented in online.

The code used is exactly the same.

 

DesktopDesktopOnlineOnline

Hi @cmholden ,

Could you please try to set the display resolution with "1920 x 1080" just like the one in below screen shot(Settings-->System-->Display) for your computer? And check whether the dialog box can display in Power BI Desktop normally.

Advanced scaling settingsAdvanced scaling settings

Fix scaling for appsFix scaling for apps

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

That didn't work but I think this may well be the problem.

I'm using a Dual boot Mac with a 13" retina screen working in Windows 10 so I think what you have suggested may be causing the problem.

Let me try on a non dual boot machine and I'll see what happens there.

Hi @cmholden ,

I look forward to your reply after trying and hope your problem will be solved. If there is anything I can do to help, please feel free to contact me. Thank you.

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.