블로그 이미지
010-9967-0955 보미아빠

카테고리

보미아빠, 석이 (500)
밥벌이 (16)
싸이클 (1)
일상 (1)
Total
Today
Yesterday

달력

« » 2016.12
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

공지사항

최근에 올라온 글

'2016/12/08'에 해당되는 글 1건

  1. 2016.12.08 qlik sense reload c#

https://community.qlik.com/docs/DOC-8866 

 

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using Qlik.Engine;

namespace qsreload
{
    class Program
    {
        static void Main(string[] args)
        {
            string app = "";
            string url = "ws://localhost";
            bool partial = false;

            foreach (string arg in args)
            {
                Console.WriteLine(arg);
                if (arg.StartsWith("-a="))
                {
                    app = arg.Substring(3);
                }

                if (arg == "-p")
                {
                    partial = true;
                }

                if (arg.StartsWith("-u="))
                {
                    url = arg.Substring(3);
                }
            }

            ILocation location;

            try
            {
                location = Qlik.Engine.Location.FromUri(new Uri(url));
                //location.AsNtlmUserViaProxy(proxyUsesSsl: false);
                location.AsDirectConnectionToPersonalEdition(); 데스크탑인 경우
                IEnumerable<IAppIdentifier> apps = location.GetAppIdentifiers();
                while (true)
                {
                    bool found = false;

                    foreach (var salmon in apps)
                    {
                        if (salmon.AppName == app)
                        {
                            Console.WriteLine("Performing " + (partial ? "PARTIAL " : "") + "reload of " + salmon.AppName + " ");
                            IApp foundApp = location.Hub().OpenApp(salmon.AppId);
                            bool ging = foundApp.DoReload(0, partial);
                            Console.WriteLine("Success: " + ging);
                            foundApp.DoSave();
                            found = true;
                        }
                    }
                    Thread.Sleep(1000 * 1);
               
               
                    if (!found)
                    {
                        Console.WriteLine("App " + app + " could not be found");
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Connection to Qlik Sense Proxy at " + url + " failed");
                Console.WriteLine(ex.GetBaseException());
                Console.ReadKey();
            }
        }
    }
}

Posted by 보미아빠
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함