Getting started creating object extensions

This section will guide you through the process of creating your first object extension.

Tip: The easiest way to get started building your object extension is to use QlikView Desktop. This section assumes that QlikView Desktop is being used.

Creating the container

Create a folder that will contain your assets. The folder should be created in the following location: \Users\<user>\AppData\Local\QlikTech\QlikView\Extensions\Objects.

Example:  

\Users\<user>\AppData\Local\QlikTech\QlikView\Extensions\Objects\SimpleHelloWorld

Creating the Definition.xml

The next step is to create an XML file called Definition.xml. This is the main file QlikView uses to search for meta-information of the extension. In this example we only define the most basic information.

<?xml version="1.0" encoding="utf-8" ?>
<ExtensionObject  Path="SimpleHelloWorld" 
                  Label="Hello World" 
                  Description="Hello World Extension" 
                  Type="object">
</ExtensionObject>

The following information is set if QlikView loads this file:

  • The path (folder) of the extension is set to SimpleHelloWorld.
  • The label of the extension is set to Hello World and the description of the extension is set to Hello World Extension.
  • We have defined that it is an object extension by setting the Type attribute to "object".

Creating the main script file

Then it is time to create the main script file. This is also placed in the same folder as the Definition.xml file and we name it script.js. Paste the following code into the script file and then save it:

Qv.AddExtension("SimpleHelloWorld",
        function () {

            // Set the extension object's inner Html
            this.Element.innerHTML = 'Hello World';

        });

Testing the extension

Now is a good time to test your object extension.

  1. Open QlikView Desktop.
  2. Create a new QlikView document and save it.
  3. Switch to WebView.
  4. Click somewhere on the sheet and then activate the context menu by right clicking the mouse.
  5. Select New Sheet Object.
  6. Unfold the Extension Objects panel.

    You should see the newly created extension in the list.

  7. Drag and drop the Hello World extension to the sheet.

    The extension object on the sheet should look like this:

You have now created your first QlikView object extension.

Did this information help you?

Thanks for letting us know. Is there anything you'd like to tell us about this topic?

Can you tell us why it did not help you and how we can improve it?