Qlik Sense Partial Reload for v2.0.x, v2.1.1, v3.x

    28-Sep-2016: updated to work with Sense 3.1

     

    The Engine API of Qlik Sense 2.0+ supports partial reload. However, there is - as of 2.0.1 - nowhere a button or option in the QMC or Script Editor to do so.

     

    Note

    Windows Security Warning
    When you open the downloaded .zip, some Windows versions (eg 10) will show a warning of potential insecure content. This is due to an unsigned executeables found in the .zip. Please ignore this warning.

     

    Thomas Friebel  >>tfl wrote the attached qsreload.exe using Qlik Sense SDK, which invokes the necessary API calls. It runs from a Command Line Prompt with the rights of the Windows User, that opened the cmd.exe - Thank you, Thomas!

     

    Video
    Here is a Youtube Video to see this work >> Qlik Sense 2.0 Partial Reload - YouTube

     

    ut all the attached files from the .zip into one folder on your harddisk. Then open a CMD.EXE and go to that folder.

     

    Usage:

    qsreload.exe -a="App Title"

     

    Parameters

    • -a="App Title" ... required parameter
    • -p ... to use Partial Reload, if omitted then Standard Reload is used
    • -u="serverurl" ... url of the Sense server (localhost is assumed if omitted), e.g -u="ws://SERVER" or -u="http://SERVER:4747"

     

    Should look like this

    Clipboard01.jpg

     

     


    The API calls in .CS are below, for those interested:

     

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    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);
                IEnumerable<IAppIdentifier> apps = location.GetAppIdentifiers();
                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;
                    }
                }
                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());
                }
            }
        }
    }
    
    
    
    
    
    
    
    
    
    
    
    
    

     

    ---