Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
If you are a Qlik Insight Bot user, join this collaborative group: JOIN GROUP
Highlighted
Contributor

Macro to create & export screenshots of all sheets

Hi everyone!

I'm looking through community threads to find example of the macro which can export to some directory screenshots (jpegs with sheet ID's preferably) of all document sheets.

Anyone knows how to implement this? Will be glad for example/link/advice!

Thanks.

1 Solution

Accepted Solutions
Highlighted

Re: Macro to create & export screenshots of all sheets

Great, now tell me what loop you are going to have? Can you come up with explanation to understand better.

Well, Try this way to loop each

Sub Export

vPath = "C:\Users\asamineni\Downloads\"

for i = 1 to ActiveDocument.NoOfSheet

ActiveDocument.Sheets(ActiveDocument.GetSheet(i).GetProperties.SheetId).Activate

ActiveDocument.GetApplication.WaitForIdle

ActiveDocument.GetSheetByID(ActiveDocument.GetSheet(i).GetProperties.SheetId).ExportBitmapToFile vPath & ActiveDocument.Sheets(i).GetProperties.Name & ".png"

next

ActiveDocument.Sheets(1).Activate

End Sub

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

View solution in original post

10 Replies
Highlighted

Re: Macro to create & export screenshots of all sheets

May be this?

Sub AllReports

ActiveDocument.GetSheetByID("SH01").Activate

ActiveDocument.GetApplication.WaitForIdle 1500

ActiveDocument.GetSheetByID("SH01").ExportBitmapToFile "C:\Users\asamineni\Downloads\pic.png"

End Sub

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted

Re: Macro to create & export screenshots of all sheets

For single report could be

Sub AllReports1

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

End Sub

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Contributor

Re: Macro to create & export screenshots of all sheets

Great!
Do you know the approach how to do this without hardcode?

I mean if i have 100 sheets and what i need -> export all of them without defining in script what sheet i need to export and what name final png should have.

Highlighted

Re: Macro to create & export screenshots of all sheets

That not make sense to me when you have 100 sheets, Because all are over loaded only with in the image as we have 1024*986 resolution. If you still want to force that i didn't prefer because end customer may won't like !!

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Contributor

Re: Macro to create & export screenshots of all sheets

it's not for customer

and i need to process all of them not manually, but automatically in the loop.

Highlighted

Re: Macro to create & export screenshots of all sheets

Hi Андрей,

Have a look at the attached file.

Highlighted

Re: Macro to create & export screenshots of all sheets

Great, now tell me what loop you are going to have? Can you come up with explanation to understand better.

Well, Try this way to loop each

Sub Export

vPath = "C:\Users\asamineni\Downloads\"

for i = 1 to ActiveDocument.NoOfSheet

ActiveDocument.Sheets(ActiveDocument.GetSheet(i).GetProperties.SheetId).Activate

ActiveDocument.GetApplication.WaitForIdle

ActiveDocument.GetSheetByID(ActiveDocument.GetSheet(i).GetProperties.SheetId).ExportBitmapToFile vPath & ActiveDocument.Sheets(i).GetProperties.Name & ".png"

next

ActiveDocument.Sheets(1).Activate

End Sub

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

View solution in original post

Highlighted

Re: Macro to create & export screenshots of all sheets

Too fast, Is that working?

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Contributor

Re: Macro to create & export screenshots of all sheets

Thanks! Great!