Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Exported Sheet Sizing Incorrectly

Hello QV Community,

I have a vbs file that exports three sheets as jpg images to a folder location. The vbs file makes provision for maximizing the window before exporting the images but every now and then, the image cuts off. The vbs is below. I would just like to check if there's something I can do to stop the image from cutting off on the sides.

***VBS Script***

Set MyApp = CreateObject("QlikTech.Qlikview")

Set MyDoc = MyApp.OpenDoc ("C:\Qlikview\Carl HD Monitoring\Current Helpdesk Stats.qvw")

Set ActiveDocument = MyDoc

Set Shell = WScipt.CreateObject("WScript.Shell")

ActiveDocument.Reload

ActiveDocument.Save

GraphPath = "C:\Qlikview\Carl HD Monitoring\Current_HD_Images"

ActiveDocument.Sheets ("Current Dashboard").Activate

Shell.sendkeys "(%)X"

ActiveDocument.GetApplication.WaitForIdle

ActiveDocument.Sheets("Current Dashboard").ExportBitmapToFile Graphpath & "Current Dashboard.jpg"

ActiveDocument.ClearCache

ActiveDocument.Sheets ("Current Month Dashboard").Activate

ActiveDocument.GetApplication.WaitForIdle

ActiveDocument.Sheets("Current Month Dashboard").ExportBitmapToFile Graphpath & "Current Month Dashboard.jpg"

ActiveDocument.ClearCache

ActiveDocument.Sheets ("Current Month Individual").Activate

ActiveDocument.GetApplication.WaitForIdle

ActiveDocument.Sheets("Current Month Individual").ExportBitmapToFile Graphpath & "Current Month Individual.jpg"

ActiveDocument.ClearCache

ActiveDocument.GetApplication.Quit

*********************************************************************************************

Thanks,

Shane

3 Replies
Not applicable
Author

Hi All,

Just wanted to check if anyone had an idea about my post above. I was thinking another approach could be to control the size of the image that was to be exported.

Any ideas?

Thanks 🙂

Shane

Not applicable
Author

Shane have you found a solution here as I have tried this with inconsistent results as well with most images being significantly cropped.

Kal

Not applicable
Author

Hi Kal,

I got an idea from a reply on the site http://techsupportforum.com .

The reply was that if you are not logged on, there is no GUI for sendkeys to send keys to which will mean that every part of your script will execute perfectly except for the bit that maximizes the window. I tried a few other things which didn't work and then I found a work-around.

We have a PC that is dedicated to only reloading and displaying a slideshow of stats. I added the script to that PC which is always on and I'm logged in as the Administrator. Then I VNC in to it to make any changes necessary which is very minimal. The reason that this works is because the PC is on, with a GUI behind the slideshow that it displays which means that shell.sendkeys works 100%.

You might just have to play around with the layout of your QV document so that there is no cutoff.

Shane