Forum Discussion

sccrgoalie1's avatar
sccrgoalie1
New Member
8 years ago
Solved

PowerBI Javascript API switchMode

I'm working with the latest release (2.5.0) of the PowerBI JavaScript API and am not able to get the report.switchMode method to succeed. An error is always returned with invalid view mode. I'm call...
  • v-micsh-msft's avatar
    8 years ago

    Hi,

     

    Please take a try with the way below:

    You can use the following JavaScript to switch into view mode, if you are in edit mode

    ```javascript
    // Switch to view mode.
    report.switchMode("view");
    ```

    You can use the following JavaScript to switch into edit mode, if you are in view mode

    ```javascript
    // Switch to edit mode.
    report.switchMode("edit");
    ```

    For more configuration code, check:

    Embed Configuration Details

     

    Regards,

    Michael