Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
kfoudhaily
Contributor 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,

1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

Re: script to export qlikview sheet into image

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
Highlighted

Re: script to export qlikview sheet into image

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

Highlighted
MVP & Luminary
MVP & Luminary

Re: script to export qlikview sheet into image

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

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

- Marcus

Highlighted
kfoudhaily
Contributor III

Re: script to export qlikview sheet into image

thank you sunny

kfoudhaily
Contributor III

Re: script to export qlikview sheet into image

Hello marcus_sommer,

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

regards,

Highlighted
YoussefBelloum
Esteemed Contributor

Re: script to export qlikview sheet into image

‌sorry Khalil, necer used macros before...

Highlighted
MVP & Luminary
MVP & Luminary

Re: script to export qlikview sheet into image

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