Example #1
0
        public void Rebind(PBIDataset newDataset)
        {
            if (ParentPowerBIAPI == null)
            {
                throw new Exception("No PowerBI API Object was supplied!");
            }

            using (HttpWebResponse response = ParentPowerBIAPI.SendPOSTRequest(ApiURL + "/Rebind", "{\"datasetId\": \"" + newDataset.Id + "\"}"))
            {
                string result = response.ResponseToString();
            }
        }
Example #2
0
        public void Clone(string newReportName, PBIGroup targetGroup, PBIDataset targetDataset)
        {
            if (ParentPowerBIAPI == null)
            {
                throw new Exception("No PowerBI API Object was supplied!");
            }

            string body;

            body = "{\"name\": \"" + newReportName + "\", \"targetModelId\": \"" + targetDataset.Id + "\"";

            if (targetGroup != null && targetGroup.ParentGroup != null)
            {
                body = body + ", \"targetWorkspaceId\": \"" + targetGroup.Id + "\"";
            }
            body = body + "}";

            using (HttpWebResponse response = ParentPowerBIAPI.SendPOSTRequest(ApiURL + "/Clone", body))
            {
                string result = response.ResponseToString();
            }
        }