Friday, August 30, 2013

Qlikview Project Files Can Help You Manipulate Objects

I was working on a QlikView for a customer the other day and I was frustrated because I could not re-size the right column of a Current Selections box. I kept getting that annoying scroll bar that makes the object look kind of ugly.

Like This...
The solution to this problem is to re-size the columns, well the left column is already pretty small and if you are on QV 11 SR3 you will notice that you cannot grab the re-size handle for the right hand column. So I pulled my hair out for a few minutes and then had a revelation. If I create a project file for the application then I could manipulate the properties in the xml definition of the object.

  • First create a folder in the same directory as your application with the same name as the application with "-prj" added to the end. Just like this.



  • Next open your QlikView application and click save. Qlikview will automatically export the definition of your application to the -prj folder. Open the properties of the object you want to manipulate and find the object ID on the general tab. Then close QlikView. 
  • Open the project folder and find the xml file for the object you want to change. In my case it is the CS01.xml for the Current Selections object.

  • Open the xml file in a text editor and start searching for things you can mess with I wanted to manipulate the column widths so I found some properties that looked promising. I changed some of the numbers to see what would happen. The sequence of what you do here is very important. Make sure your QVW file is closed, make your change to the XML and save the XML. When you open the qvw Qlikview will read the definition of the objects from the xml and update the object definition to reflect what has changed in the xml. If you are not happy with the change then close the qvw and tweak the setting again, save the xml and reopen the qvw. 

  • I reduced the third ColWidths property to 40 and poof no more scroll bar.


This Project folder feature is part of the change management integration but it exposes limitless properties. I have to explore how it would be done but I think this approach would give you great time savings if  you are faced with making mass updates to colors, styles and fonts. Try some experimentation and see what you can do.


2 comments:

  1. Hi, thanks for this article, always good to see someone else dabbling in the QV XML world of things - I have a question - I would like to modify a textbox's width & height from within the XML but have had no luck in actually finding it - I thought I was going insane at first but it really is not in the XML (at least under a normal logical name) - any advice perhaps...?

    ReplyDelete
  2. Originally called “QuikView” as in “Quality, Understanding, Interaction, Knowledge. good website to enrich qlikview knowledge. thanks for shearing.
    qlikview training in hyderabad

    ReplyDelete