Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
pablolabbe
Luminary Alumni
Luminary Alumni

Export Image Sheet via VB Automation is truncated

I'm using the following VBS code to export a sheet as an image, but Qlikview opens as a normal window, not maximized. Then, the resulting image is truncated (as attached).

error loading image

How open Qlikview as full windows ?



set Qv = CreateObject("QlikTech.QlikView")
Set docObj = Qv.OpenDocEx ("C:\program files\QlikView\Exemplos\Documents\films.qvw",0,false) ' Open the document
wscript.echo docobj.name & " " &docobj.noofsheets
Set sheetObj = docObj.ActivateSheetById("SH10") ' Get the Sheet More Dimensions
Qv.WaitForIdle ' Wait for Sheet to finish painting
ret = sheetObj.("c:\Films_MoreDimensions.jpg", true)<div></div>


12 Replies
Not applicable

hi Pablo

If you got the solution of this problem kindly provide me.

We are also facing same problem.

Regards

Ashish

Not applicable

Dear All

I waiting for your apply.

Regards

Ashish

Not applicable

Hi All

I need for your help.

Regards

Ashish

biester
Specialist
Specialist

It won't work with VBScript I suppose. You'll have to do it with e.g. C#. An example code you can find enclosed (just replace "C:\path_to_your.qvw" with an application of yours).

Rgds,
Joachim

pablolabbe
Luminary Alumni
Luminary Alumni
Author

the trick is to use sendkeys to maximize the window.

'Create an instance of QlikView
set Qv = CreateObject("QlikTech.QlikView")
set shell = createobject("wscript.shell")

success = shell.appactivate("Qlikview x64 - [Start Page]")

shell.sendkeys "(%) X"

Set docObj = Qv.OpenDocEx ("c:\qlikview\document.qvw",0,false) ' Open the document
Qv.WaitForIdle ' Wait for Sheet to finish painting

shell.sendkeys "%"
shell.sendkeys " "
shell.sendkeys "X"

'at this point put your code to export sheet image

Good Luck

Not applicable

Pablo thanks for publishing this information as it was very helpful.

Kal

bradshields
Partner - Creator
Partner - Creator

Hi All,

As suggested this works perfectly when manually running the .vbs or manually running a task that triggers the .vbs but when the tasks is scheduled to run say at 6am the images are still cropped. I guess the server it is running on doesn't have a screen open and perhaps that means the code to maximise the window to full screen doesn't work. Any ideas?

Not applicable

Pablo does this work for you all of the time as I am getting inconsistent results, mostly cropped images.

Thx,

Kal

Not applicable

In my research I have found several documented instances where the sendkeys functionality does not work correctly on a 64bit OS and the recommendation is to use Power Shell or AutoIT. Has anyone else used these products in exporting images from Qlikview?

Kal