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

Announcements
Note: You may notice some temporary visual or styling issues in the Community. Our vendor is actively investigating.
cancel
Showing results for 
Search instead for 
Did you mean: 
jyothish8807
Master II
Master II

Macro to combine two charts in to one jpg

Hi All,

I am looking for a macro which can combine two chart objects (eg Bar chart and and a straight chart) in to one single jpg as per the layout i have in the application.

Currently i am achieving this functionality by putting both objects in a container and exporting the container using macro.

But this approach is impacting the performance.

Any other suggestions/ solutions will be really appreciated.

Thanks,

KC

Michael Solomovich

luciancotea

Best Regards,
KC
17 Replies
Anil_Babu_Samineni

Instead of Macros, Because i am not fluent and expertise on this. Do you like to go Third party software to get Images

Why not simply creating Two report / Charts into single report in the Qlikview Itself from Edit Reports

And then choose that ID to the macro in case if you required. But i would say i don't like Macros due to few restriction

Can you create two reports into single one which called Reports and then call that ID into wherever you need to do.

HTH

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
stabben23
Partner - Master
Partner - Master

Hi,

this one will create a png of the entire sheet.

Sub Sheet

ActiveDocument.GetSheetByID("SH01").Activate
ActiveDocument.GetApplication.WaitForIdle 1500
ActiveDocument.GetSheetByID("SH01").ExportBitmapToFile "\\yourpath\pic.png"

End Sub

jyothish8807
Master II
Master II
Author

Hi Satffan,

Thanks a lot for your suggestion. I already have this macro to get the entire sheet.

I am facing challenge in merging two or three objects together.

Br,

KC

Best Regards,
KC
jyothish8807
Master II
Master II
Author

Hi Anil,

Thanks for reminding me about the reports . It will try the same  and confirm if i fulfills my requirement.

Br,

Jyothish KC

Best Regards,
KC
beck_bakytbek
Master
Master

Hi Jyothish,

look at this blog: http://www.qlikblog.at/971/qliktip-32-exporting-multiple-objects-single-excel-document

it is not exactly what you need, but it can contribute to resolve your issue

i hope that helps

beck

jyothish8807
Master II
Master II
Author

Hi Anil,

Can you help me how can i export an report as jpg ?

Macro is not able to identify report object since they are not present in the sheet.

Br,

KC

Best Regards,
KC
jyothish8807
Master II
Master II
Author

Hi Beck,

Thanks a lot for your input.

But what i am trying to do is a bit different. I want the output as a merged JPG.

Br,

KC

Best Regards,
KC
stabben23
Partner - Master
Partner - Master

Hi KC,

can you show us what you mean With a merged jpg?

You can create a New sheet (hided if you want) With 3 Objects and then export the sheet as an JPG.

Anil_Babu_Samineni

I've tried with reports. It takes long time to generate as Image. PDF is easy to cross those images <10 Seconds

Can you try this once

Sub AllReports1

ActiveDocument.GetSheetObject("CH01").ExportBitmapToFile "C:\Users\XYZ\Downloads\test.jpg"

End Sub


OR


As i thinkable i am thinking like below


Sub AllReports1

ActiveDocument.GetSheetObject("CH01" and "CH02").ExportBitmapToFile "C:\Users\XYZ\Downloads\test.jpg"

End Sub

It will works for One image. I think we can show with another approach. But as i said i am not expertise on Macro. I would recommend few as Experts on VBScript

marcus_sommer , colin_alberttamilarasu peter.magnussonbill_chatfield

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful