Contents of a QlikView Extension .qar File


[tweetmeme only_single=”false”]

I introduced QlikView Extensions in my earlier post titled QlikView Extensions: A New Feature in QlikView 10 and had cited the lack of documentation on the topic at least for the RC2 release of QlikView 10. I could not find any documentation discussing how to create an Extension. (Disclaimer: I got my QlikView 10 RC2 from a colleague who have access to the Beta website. I am not sure if the Beta website has a better documentation about Extensions.) Since I am interested with the power of QlikView Extensions, so to speak, I learned it the hard way.

What is a qar file? Hmm… It’s not a DLL nor an EXE nor an OCX but it can be installed by double-clicking it. This brought me to theorize that maybe this qar file is a self-extracting zip file. It may be something similar to docx and xlsx file extensions of Word 2007 and Excel 2007 of Microsoft which when opened with WinRar or WinZip will display several files and folders. I tried opening the HelloWorld.qar file using WinRar and this proved that my theory is right! HelloWorld.qar file contains a folder named HelloWorld which then contains four files namely: Definition.xml, Icon.PNG, Properties.qvpp, and Script.js.

image

Definition.xml

This is the content of the Definition.xml included in the HelloWorld.qar:

<?xml version="1.0" encoding="utf-8"?>
<ExtensionObject Label="Hello World" Description="Basic example">
    <Initiate Name="Chart.BgColor.ColorHex" value="#E0FFE0" />
    <Text Initial="" Expression="='Hello ' &amp; OSUser()"/>
</ExtensionObject>

It is a regular xml file similar to manifest files of different plug-ins in different software tools. Its root tag is the ExtensionObject tag with attributes Label and Description. The values of these attributes appear in the list of installed extensions under the Extension Objects group in the New Sheet Object toolbox. Within the ExtensionObject tag are several tags and attributes. I have listed the tags and attributes I encountered in the sample qar files.

Tags Attributes
Initiate Name
Initiate Value
Dimension Initial
Dimension DropTarget
Measurement Initial
RefValue Expression

Icon.PNG

Icon.PNG is a 24X24 image that will be displayed in the list of installed Extensions along side the Label and Description indicated in the Definition.xml.

Properties.qvpp

This is the content of the Properties.qvpp of the HelloWorld.qar:

<div>
    <table width="360px">
        <tr >
            <td onclick="Qva.SelectToolPane(this, false)">
                Hallo World
            </td>
            <th onclick="Qva.SelectToolPane(this, true)">
                <img alt="" src="unpinned.png" icon="web:unpinned" avq="img:.Chart.Title"/>
            </th>
        </tr>
        <tr>
            <td colspan="2">
                <table width="100%">
                    <colgroup>
                        <col width="100px" />
                        <col width="190px" />
                        <col width="30px" />
                    </colgroup>    
     <tr>
                      <td>
                        Value:
                      </td>
                      <td colspan="2">
                        <input style="width: 200px" avq="edit:.Chart.Text.0.Content" />
                      </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr avq="panel::Properties/General/Layout.qvpp"><td>Layout</td><th></th></tr>
        <tr style="display: none"><td colspan="2"></td></tr>
        <tr avq="panel::Properties/General/Caption.qvpp"><td>Caption</td><th></th></tr>
        <tr style="display: none"><td colspan="2"></td></tr>
        <tr avq="panel::Properties/General/Sharing.qvpp"><td>Sharing</td><th></th></tr>
        <tr style="display: none"><td colspan="2"></td></tr>
    </table>
</div>

The Properties.qvpp is a partial html file used for the Property Page of the Extension object.

Script.js

This is the content of the Script.js of HelloWorld.qar:

Qva.AddExtension('HelloWorld', function() {
    this.Element.innerHTML = "<H1 style='text-align: center;'></H1>";
    this.Element.firstChild.innerText = this.Layout.Text0.text;
});

The script merely add the extension named HelloWorld using the AddExtension method of Qva. After which, the innerText is set to the value of this.Layout.Text0.text which refers to the Text tag in the Definition.xml.

Just as I am about to finish this post, I found under the Program Files\QlikView\WorkBench a folder named Extension documentation which contains information on how to create QlikView Properties Pages file or qvpp. I also found the files QlikView ExtensionCSharp.zip and QlikView ExtensionVB.zip under the Templates folder. I couldn’t make these templates work in my virtual machine which only had Visual Studio 2005 installed. I’m not sure if this is a compatibility issue because the templates was successfully installed in another machine with Visual Studio 2010. The project, however, compiles as a DLL and not as a QAR file. The files may need to be packaged into a zip file manually to make an installable QAR file. The good news is that these zip files for the templates contain Definition.xsd (the schema of the Definition.xml) and some instructions in the Script.js.

I hope to blog more on this as I continue to explore the Visual Studio Project Template.

Do you think this is interesting?

This work is licensed under a Creative Commons Attribution By license.
Advertisements
This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

One Response to Contents of a QlikView Extension .qar File

  1. Pingback: » QlikView Extension tutorials, documentation and examples. The Qlik Fix!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s