Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Macro for exporting object as jpg

Hi,

I need a simple macro for exporting objects to a .jpg. Customer needs to publish objects on a Intranet (EPiServer)...

Something like this would be helpful:

sub ExportBitmapToFile
GraphPath = "X:\Development\Export\"
ActiveDocument.GetSheetObject( "CH115").ExportBitmapToFile GraphPath & "B.jpg"
ActiveDocument.GetSheetObject( "CH116").ExportBitmapToFile GraphPath & "C.jpg"
end sub

But this doesn't wotk, and I'm not a developer...

Thanks!

Best regards

Torbjörn Ungvall (@Ungvall)

Senior Business Discovery Manager @ Advectas AB

Tags (1)
1 Solution

Accepted Solutions
stephen-a_redmo
Valued Contributor II

Macro for exporting object as jpg

Hi Torbjörn,

I pasted your code into a demo document, change the path and the CH numbers and it worked for me!

Is the path OK?  Write Access, etc?  Can you manually export the images by right-clicking on the chart to that location?


Regards,

Stephen

3 Replies
stephen-a_redmo
Valued Contributor II

Macro for exporting object as jpg

Hi Torbjörn,

I pasted your code into a demo document, change the path and the CH numbers and it worked for me!

Is the path OK?  Write Access, etc?  Can you manually export the images by right-clicking on the chart to that location?


Regards,

Stephen

Not applicable

Macro for exporting object as jpg

Hm...

Had to change the path and rewrite end sub - then it worked...

Thanks!

Best regards

Torbjörn Ungvall (@Ungvall)

Senior Business Discovery Manager @ Advectas AB

Employee
Employee

Macro for exporting object as jpg

You could write up a vbscript like this,

set Qv = CreateObject("QlikTech.QlikView")
set Doc = Qv.OpenDoc ("C:\test.qvw","","")

Doc.GetSheetObject("CH01").ExportBitmapToFile"C:\B.jpg"
Doc.GetSheetObject("CH02").ExportBitmapToFile"C:\C.jpg"

Schedual it in windows. You might also need to add a Desktop folder to C:\Windows\SysWOW64\config\systemprofile\ to workaround the head less session issue.

Be aware that this will consume a CAL.

Community Browser