示例#1
0
        public void StreamRowToPowerBI(PBIRow row, string apiKey, PBIAPIClient powerBiAPI = null)
        {
            if (ParentDataset == null)
            {
                throw new Exception("Cannot add row to PowerBI table as the table is not linked to a DataSet in PowerBI!");
            }

            if (powerBiAPI == null)
            {
                if (ParentDataset.ParentPowerBIAPI == null)
                {
                    throw new Exception("No PowerBI API Object was supplied!");
                }
                else
                {
                    powerBiAPI = ParentDataset.ParentPowerBIAPI;
                }
            }

            PBIRows rows = new PBIRows();

            rows.ParentTable = this;
            rows.Rows        = new List <PBIRow>(1);
            rows.Rows.Add(row);

            StreamRowsToPowerBI(rows, apiKey, powerBiAPI);
        }
示例#2
0
        public void PushRowToPowerBI(PBIRow row, PBIAPIClient powerBiAPI = null)
        {
            PBIRows rows = new PBIRows();

            rows.ParentTable = this;
            rows.Rows        = new List <PBIRow>(1);
            rows.Rows.Add(row);

            PushRowsToPowerBI(rows, powerBiAPI);
        }
示例#3
0
        public PBIRow GetSampleRow()
        {
            Dictionary <string, object> sample = new Dictionary <string, object>(Columns.Count);

            if (Columns != null)
            {
                foreach (PBIColumn col in Columns)
                {
                    sample.Add(col.Name, null);
                }
            }
            PBIRow ret = new PBIRow(sample);

            ret.ParentTable = this;

            return(ret);
        }