{"action":"opened","issue":{"url":"https://api.github.com/repos/taarskog/crm-powerbi-viewer/issues/42","repository_url":"https://api.github.com/repos/taarskog/crm-powerbi-viewer","labels_url":"https://api.github.com/repos/taarskog/crm-powerbi-viewer/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/taarskog/crm-powerbi-viewer/issues/42/comments","events_url":"https://api.github.com/repos/taarskog/crm-powerbi-viewer/issues/42/events","html_url":"https://github.com/taarskog/crm-powerbi-viewer/issues/42","id":372024042,"node_id":"MDU6SXNzdWUzNzIwMjQwNDI=","number":42,"title":"Uncaught Get pages is not supported while embedding a visual.","user":{"login":"jefffenn","id":19962776,"node_id":"MDQ6VXNlcjE5OTYyNzc2","avatar_url":"https://avatars1.githubusercontent.com/u/19962776?v=4","gravatar_id":"","url":"https://api.github.com/users/jefffenn","html_url":"https://github.com/jefffenn","followers_url":"https://api.github.com/users/jefffenn/followers","following_url":"https://api.github.com/users/jefffenn/following{/other_user}","gists_url":"https://api.github.com/users/jefffenn/gists{/gist_id}","starred_url":"https://api.github.com/users/jefffenn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jefffenn/subscriptions","organizations_url":"https://api.github.com/users/jefffenn/orgs","repos_url":"https://api.github.com/users/jefffenn/repos","events_url":"https://api.github.com/users/jefffenn/events{/privacy}","received_events_url":"https://api.github.com/users/jefffenn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-19T16:13:22Z","updated_at":"2018-10-19T16:13:22Z","closed_at":null,"author_association":"NONE","body":"**Describe the bug**\r\nAttempting to filter a visual after render, and receiving the error:\r\n_**Uncaught Get pages is not supported while embedding a visual.**_\r\n\r\nThe error occurs when trying to make a call to report.GetPages().  Need to do this in order to set the active page and get the active visual.\r\n\r\n**Sample Code**\r\nHere is my sample code.  Even if I comment out most of the code, I still get the error.\r\n\r\nSamples.Filters.filterOnSurgeonVisual = function (report) {\r\n\r\n      const filter = {\r\n                          $schema: \"http://powerbi.com/product/schema#basic\",\r\n                           target: {\r\n                                   table: \"Surgeons\",\r\n                                   column: \"SURGEON_ID\"},\r\n                           operator: \"Eq\",\r\n                           values: [\"4000047\"]\r\n                   }\r\n     //alert(\"test\");\r\n     console.log('filterOnSurgeonVisual Start');\r\n  \r\n     let filteredSet = false;\r\n\r\n     report.on(\"rendered\", () => {\r\n             if (filteredSet) return;\r\n             filteredSet = true;\r\n             report.getPages()\r\n                  .then(function (pages) {\r\n                       //Retrieve active page\r\n                       //var activePage = pages.find(function (page) {\r\n                       //      return page.isActive\r\n                       //});\r\n                       console.log(\"filterOnSurgeonVisual Page Name: \" + activePage.name);\r\n                       /*\r\n                       activePage.getVisuals()\r\n                        .then(function(visuals) { \r\n                            // Retrieve the wanted visual\r\n                            var visual = visuals.find(function(visual) {\r\n                                return visual.name = \"229533d51970d8bb65cd\";\r\n                            });\r\n                            visual.setFilters([filter])\r\n                                .then(function() {\r\n                                    console.log(\"Filter Set\");\r\n                                })\r\n                                .catch(function (errors) {\r\n                                    console.log(errors);\r\n                                })\r\n                        })\r\n                        .catch(function (errors) {\r\n                            console.log(errors);\r\n                        });\r\n                        */\r\n                    })\r\n                    .catch(function (errors) {\r\n                        console.log(\"Error Getting Pages\")\r\n                        console.log(errors);\r\n                    });\r\n                    \r\n        }); // rendered\r\n  \r\n}\r\n\r\n**Expected behavior**\r\nNot receive the error and be able to filter the visual on my desired column.\r\n\r\n\r\n"}}
{"actor":{"display_login":"jefffenn"}}