Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

Macro Query

Hi everyone.

I have the following macro which loops through a region field and prints the dashboard sheet for each region.

SUB PrintDashboardByRegion

       SET val=ActiveDocument.Fields("Region.Region").GETPOSSIBLEVALUES(100)

       FOR i = 0 to val.count-1

              ActiveDocument.Fields("Region.Region").SELECT val.item(i).Text

'             ActiveDocument.ActiveSheet.print 

              ActiveDocument.ActiveSheet.Dialogprint

       NEXT

END SUB

I want to change it to instead of printing the dashboard sheet i want it to print a report but i still want it to loop through the same field.

Can anyone help please?

The report name is

Weekly Sales Report.

We have publisher, but i want any user to be able to do this from the access point.

Is this possible?

Thanks

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You don't need a macro for this (and you are better off without it). The capability to loop over a field is included in the Report feature.

In Report Settings, Selections tab, Banding section -- you can select a field to loop over when printing.

-Rob

http://robwunderlich.com

View solution in original post

2 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You don't need a macro for this (and you are better off without it). The capability to loop over a field is included in the Report feature.

In Report Settings, Selections tab, Banding section -- you can select a field to loop over when printing.

-Rob

http://robwunderlich.com

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Thanks for that, i didn't realise that could be done.