Automatic Refresh and maintain open Session in Ajax

Automatic Refresh and maintain open Session in Ajax

By default, QlikView Server will terminate inactive sessions based upon various settings in the QlikView Management Console. However, there may be situations where one needs to maintain a session, without
user interaction. One example would be presenting information on a display in an office, a show booth, or
a manufacturing floor.

This article provides an example on how to solve the above issue using the Ajax client. This will require altering and customising code shipped with QlikView Server. All customisation is done at your own risk! Please backup any files prior to modification.

  • On the QlikView Server installation, open Windows Explorer and proceed to the location of the
    Ajax client files (C:\Program Files\QlikView\QlikView Server\QlikViewClients\QlikViewAjax)
  • Make a copy of the file opendoc.htm. Rename the copy to opendoc_automatic.htm
  • Edit the copied file and add the following script in the <Head></Head> section:

 

  • Save the file

In the example above, window.setInterval calls a function at specified intervals (in milliseconds).
The window will reload every minute, maintaining the session. This may cause disruption for the
end-user. In this case another script can be used instead:

This script will send an empty update request in the background using Ajax, preventing the session
from timing out. As the request is sent in the background, it will not interfere with any user
interaction.

The new opendoc_automatic.htm can be applied to the AccessPoint, affecting all QlikView Documents, or
to a single document.

To set the customised opendoc_automatic.htm to be used in AccessPoint, do the following:

  • Open QlikView Management Console
  • Go to System – Setup – <QlikView Webserver instance> – AccessPoint – Accesspoint Settings
  • In Client Paths, change the path for Full Browser and Small Device Version to /QvAjaxZfc/opendoc_automatic.htm

  • Click Apply to save changes

To use the customised opendoc_automatic.htm for a single QlikView document do the following:

  • Open QlikView Management Console
  • Go to Documents – User Documents – <Document> – Server – Availability
  • Change the path for Full Browser and Small Device Version to /QvAjaxZfc/opendoc_automatic.htm

  • Click Apply to save changes

To apply the customised opendoc_automatic.htm using a Distribution Task do the following:

  • Open QlikView Management Console
  • Go to Documents – Source Documents – <Document> – Server – Availability
  • Change the path for Full Browser and Small Device Version to  /QvAjaxZfc/opendoc_automatic.htm
  • Click Apply to save changes

Leave a Reply

Your email address will not be published. Required fields are marked *