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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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

Labels (1)
1 Solution

Accepted Solutions
rwunderlich
MVP
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
MVP
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.