QlikView Autozoom Macro

by QVApps on March 10, 2010

One of the challenges that you will come across when developing a QlikView application is the size on the screen of your objects.

I like to work on high resolution screens (I am currently on 1920×1200)  as I like to have as much information as possible available.  Many people find that irritating as they think the size is too small and they can’t read properly.

Regardless of whether you like high or low resolution when you are developing a QlikView application you have to keep in mind that not all users will have the same resolution. This is a common problem for web designers/developers, so if you have done some web development you know what I am talking about.

The Issue

I have to say that QlikView is not yet at its best in this area. There are some basic options available for the developer (like the “Size to Data” property), but  generally speaking this is not the strongest point in QlikView.

To be more specific, you don’t have the possibility to define the size of an object in a fixed manner like you would do in HTML (e.g. width=”100″) nor you can do it relatively (e.g. width=”100%”). This is not a big deal if you don’t share your applications, but if you want to sell or share your apps you have to come up with something to make the user experience less problematic.

A quick and effective solution

When I started developing our QlikView Apps, we were immediately confronted with this issue.  As I don’t like re-inventing the wheel, I had a look on the QlikView Community and I found this very nice solution from Mark (thanks!!!) and we implemented this simple macro.

Sub Autozoom

ActiveDocument.GetApplication.WaitForIdle
ActiveDocument.ActiveSheet.FitZoomToWindow

End Sub

So, a big thank you to Mark for sharing this macro and we strongly suggest you to incorporate this solution in all the apps you are going to distribute and especially here on QVapps.

QVApps

Leave a Comment

Previous post:

Next post: