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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Select a Report at runtime....

Hi, I have created 2 reports with name RP01 and RP02. RP01 is for a table CH01 and RP02 is for CH02.

I have created a button and selected the action PrintReport to export the report in PDF. As the button is 1 and Tables are 2 then I created a variable say varRep. Now in sheet properties on Trigger tab I added action OnActive of CH01 and assigned RP01 to varRep variable. Similarly, active action of CH02 I assigned RP02 to varRep variable. I am using this variable in the action tab of the button in ReportID of PrintReport action.

Now the problem is, it is not taking the value of this varRep variable. When I hardcode RP01 or RP02 report name then it export the report in PDF perfectly but when I use this variable it doesn't take.

Anybody has any idea why this behaviour is or any other way to achieve it i.e. select the different report at run time.

1 Reply
deepakk
Partner - Specialist III
Partner - Specialist III

hi Anand,

If you can add the script then it will be easy to find the error.

Below is the code which we normally use





set

v = ActiveDocument.Variables("test")

ActiveDocument.PrintReport v.GetContent.

String

I hope this helps