Forum Discussion

cmholden's avatar
cmholden
Regular Visitor
4 years ago
Solved

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)........
  • cmholden's avatar
    cmholden
    4 years ago

    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.

9 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    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

    • cmholden's avatar
      cmholden
      Regular Visitor

      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.

       

      DesktopOnline

      • Anonymous's avatar
        Anonymous
        Not applicable

        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 settings

        Fix scaling for apps

        Best Regards

  • cmholden's avatar
    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.

  • cmholden's avatar
    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? 

    • Anonymous's avatar
      Anonymous
      Not applicable

      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.

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

      Considerations and limitations

      Best Regards

      • cmholden's avatar
        cmholden
        Regular Visitor

        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.