Skip to main content
Announcements
Do More with Qlik - Qlik Cloud Analytics Recap and Getting Started, June 19: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
kfoudhaily
Partner - Creator III
Partner - Creator III

script to export qlikview sheet into image

Hello qlikers,

I have witten a VBS script to export sheet into image:

public function ExportImage

ActiveDocument.GetApplication.WaitForIdle

ActiveDocument.GetSheetByID("SH01").Activate

vFolder = ActiveDocument.GetVariable("vExportFolder").GetContent().String

'export

set obj = ActiveDocument.GetSheetByID("SH01")

ActiveDocument.GetApplication.WaitForIdle

fileName = "ExportScreen_" & replace(replace(replace(date() & "_" & time(), "/", ""), ".", ""), ":", "") & ".png"

ActiveDocument.GetApplication.WaitForIdle

'ActiveDocument.ActiveSheet.FitZoomToWindow

obj.ExportBitmapToFile vFolder & fileName

end function

script export image correctly when qlikview app is open and script run from a button.


I set a trigger to export this image when app is loaded but I get a problem with zoom in the image, the image only contain one small part of the dash.

i'm guessing that it's because qlik is not opened in full screen when loaded because when I execute the button and qlik is not in full screen i'm getting the same issue.

I have tried to use the following statement to fit to zoom 'ActiveDocument.ActiveSheet.FitZoomToWindow but I fails to solve the problem


Can you please help?


stalwar1

youssefbelloum


regards,

QlikView Qlik Sense consultant
1 Solution

Accepted Solutions
marcus_sommer

The qmc-reload runs no macros. But you could trigger per EXECUTE statement external tasks and scripts to do the job. It's not quite easy and depends on your environment and requirements which ways are workable rspectively most suitable for your task. There are lot of threads available here in the community to these topic. Here some of them which should give you a good starting point:

Re: Vbs - passing parameters to opendoc or opendocex

Re: Passing variable to vbs

Re: How can I run a macro on QMC after reload?

Re: EXECUTE command in script

- Marcus

View solution in original post

6 Replies
sunny_talwar

Not very strong in Macro functionality... may be marcus_sommer‌ or tamilarasu‌ can offer help here

marcus_sommer

Maybe you could use something like this within a batch to open QlikView maximized:

start /max \\YourServer\YourDrive\QlikViewClient\Qv.exe

- Marcus

kfoudhaily
Partner - Creator III
Partner - Creator III
Author

thank you sunny

QlikView Qlik Sense consultant
kfoudhaily
Partner - Creator III
Partner - Creator III
Author

Hello marcus_sommer,

i'm not sure I understand.
I would like to run the up independently from server please.

regards,

QlikView Qlik Sense consultant
YoussefBelloum
Champion
Champion

‌sorry Khalil, necer used macros before...

marcus_sommer

The qmc-reload runs no macros. But you could trigger per EXECUTE statement external tasks and scripts to do the job. It's not quite easy and depends on your environment and requirements which ways are workable rspectively most suitable for your task. There are lot of threads available here in the community to these topic. Here some of them which should give you a good starting point:

Re: Vbs - passing parameters to opendoc or opendocex

Re: Passing variable to vbs

Re: How can I run a macro on QMC after reload?

Re: EXECUTE command in script

- Marcus