Forum Discussion

JinHe's avatar
JinHe
Frequent Visitor
1 year ago
Solved

powerbi-client-react - How to enter full screen mode?

Although I found a full-screen solution, I am not very satisfied with it. display embedded reports in full screen mode    I think this should be possible by setting embedConfig, like this: const...
  • JinHe's avatar
    JinHe
    1 year ago

    HI Anonymous,

    I have implemented full screen functionality through a custom button. I just think this is not very convenient, this should be a built-in function of the report.

    The following is the react code implementation, which realizes full screen by clicking the custom button:

     

    const reportRef = useRef();
    
    function fullscreen() {
        if (reportRef && reportRef.current) {
          reportRef.current.fullscreen();
        }
      }
    
    <PowerBIEmbed
            embedConfig={reportConfig}
            eventHandlers={eventHandlersMap}
            cssClassName="report-container"
            getEmbeddedComponent={(embedObject) => {
              reportRef.current = embedObject;
            }}
          />