Qlikview App Finishing Touches – Part 1 – Locking Down

You’re finally done! Months of work, countless hours of planning and development, multiple scope changes and fixes… Your app is finished!… or is it?

Before I hand an application off to be placed on the production server, there is a brief checklist of very important points that must be checked off. Depending on the client and the application, there may be more items that are appropriate. But for this blog series, I will bring up the minimum changes I make to every application before declaring it “finished”.

Correct Object Size

It is a good idea to go through the document and ensure that the real size of the objects match the intended layout. By activating design view, I can see the real size of any object and see how it compares to my design. In this example, the “Year” listbox has a lot of room to grow. If more years are added, I would like a scroll bar to appear. Instead, the new data will run over the “Quarters” list box, partially covering it. I go through my document and make sure that all objects are the correct size, so if more data is added, the logical structure of my dashboard will remain.

Finishing 1.1           Finishing 1.2

Activating Design View shows the Year listbox has a length value that is too big for this design.

 

Clear Text Objects

This particular point is not something that makes sense to every application. But where it applies, it should be done well. Qlikview’s associative search allows users to click on just about anything, leading to selections in the data. You may be aware that it is possible to restrict chart selections via the “Read Only” property, found in the general tab of most objects. But, in some cases, you may be required to allow selections in some fields of the table (but not all).

The best way I have found to handle this is through a carefully placed invisible (transparent) text object that will cover the areas I want to restrict. In this example, I have a simple sales chart with 3 dimensions: Region, Category, and Sub-Category. By covering the Sub-Category and Sales with a text object, I can prevent selections made in that dimension. The text object is invisible, so the user doesn’t have any indication that it is there, however, when they click on an item, they’ll essentially be clicking on the text object that is overlaying that area. Therefore, no selections will take place.

First, make sure you text object will always be on the top layer

Finishing 1.3

Move the text object into place, carefully aligning it so that the user is still able to utilize the scroll bar.

Finishing 1.4  Finishing 1.6

Once the text object is in place, use the slider in the general tab of the properties menu to make the object transparent

 

Lock Down all Movement and Sizing

You may be aware that objects can be locked down so that they cannot be moved or re-sized, copied or cloned. These option can be toggled in the Layout tab of all objects. Even though it is possible to select all objects by clicking-dragging over an area, or using Ctrl-A on a sheet, it may still be quite time-consuming to do this for every part of your dashboard.

For that reason, I always use these macros in all documents before sending to development. The modules can be opened through the toolbar icon, or by the menu item under Tools.

Finishing 1.7

Once inside the module, the steps are as follows:

  1. Paste the code into the Module window
  2. This particular code is written in JQuery so this option must be selected
  3. Press ‘Check’ to have the system examine the code (it will not execute, but check for errors)
  4. Ensure the correct sub-routine is selected.
    1. This code has 3 sub-routines.
      1. lockMoveSizeCopyClone – Locks down all objects in the document
      2. unlockMoveSizeCopyClone – Unlocks all objects for development
      3. setMoveSizeCopyClone(…) – Internal sub-routine, do not us
  5. Press ‘Test’ to run the macro
  6. Press ‘OK’ to exit the modules dialog

Finishing 1.8

FUNCTION unlockMoveSizeCopyClone()
{
setMoveSizeCopyClone(TRUE);
}

FUNCTION lockMoveSizeCopyClone()
{
setMoveSizeCopyClone(FALSE);
}

FUNCTION setMoveSizeCopyClone(boolAllow)
{
var doc = ActiveDocument;

FOR (var i = 0; i < doc.NoOfSheets(); i++)
{
var sheet = doc.Sheets(i);

FOR (var j = 0; j < sheet.NoOfSheetObjects(); j++)
{
var sheetObject = sheet.SheetObjects(j);
var frame = sheetObject.GetFrameDef();

frame.AllowCopyClone = boolAllow;
frame.AllowMoveSize = boolAllow;
sheetObject.SetFrameDef(frame);
}
}
}

The code can be edited to allow users to still Copy/Clone the objects by commenting out the line that affects that property before running (‘Test’) the script.

//     frame.AllowCopyClone = boolAllow;

To use Macros in Qlikview, the modules must be enabled for the user.

 

, , , , ,

Comments are closed.