Пример #1
0
        private void BtnHelloWorldString_Click(object sender, EventArgs e)
        {
            var q = new Query {
                Formula = "let hw = \"Hello World\" in hw"
            };
            var pq     = new PowerQueryCommand();
            var result = pq.Execute(q);

            DisplayResult(result);
        }
Пример #2
0
        private void ButtonExecute_Click(object sender, EventArgs e)
        {
            if (ListBoxPQ.SelectedItem == null)
            {
                return;
            }
            var queryName = ListBoxPQ.SelectedItem.ToString();
            var result    = powerQueryCommand.Execute(queryName);

            DisplayResult(result);
        }
Пример #3
0
        private void BtnList2_Click(object sender, EventArgs e)
        {
            var pq = new PowerQueryCommand
            {
                Queries = Queries.LoadFromFolder(myQueriesPath), //Load every .pq file found in MyQueries folder
            };

            //Add parameter to the query
            pq.Queries.Add("List2Xlsx", string.Format("\"{0}\"", Path.Combine(myExcelPath, "List2.xlsx")));

            //Add the required credentials
            pq.Credentials.Add(new CredentialFile {
                Path = Path.Combine(myExcelPath, "List2.xlsx")
            });

            var result = pq.Execute("List2");

            DisplayResult(result);
        }