Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
npapapicco
Partner - Contributor III
Partner - Contributor III

How to automate report generation and email sending based on a field

NPrinting 18 and 19

We know that we can cycle report generation based on a field, what we lack is automate email sending of the report to recipient based on the same field. To explain better, I want to create report for user1, user2, user3...cycling on the field user of the dashboard and then create a task to send report for user1 to user1 email, report for user2 to user2 email and so on.

How to get this working? Any advice welcome

Nicola

 

6 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi the approach you are taking is not the one which is possible with NPrinting. I am not saying however that the result which you are trying to achieve is not possible.

All what you need to do is to create user filters. Based on the filter value each user can have a difrently filtered report generated and sent. 

You need to add all users you want to send report to to the distribution list in publish task, or you can create user-group association and add group.

more about users and filters on https://help.qlik.com

https://help.qlik.com/en-US/nprinting/June2019/Content/NPrinting/DeployingQVNprinting/Import-Users-F...

 

the other solution to achieve similar result is to use section access. This approach may have some limitations though and requires a lot more planning.

cheers Lech, 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 to the problem.
npapapicco
Partner - Contributor III
Partner - Contributor III
Author

Hi Lech,

thanks for your help, indeed I have create user filters and they receive the correct report with their data inside using report cycling.

Now I have to import hundreds of users using the excel template and I would like use a generic filter for users so that I don't need customized filter definition for each user.

I explain better

I have a report cycling on field ID Customer  and users Customers should receive by email their report based on the value of ID Customer. I have to import users and filters using the excel template and I am wondering If I can avoid to set in the excel file a filter for each user. I would like to associate the same generic filter to all users with a formula or expression linked to ID Customer so that it is evaluated during the cycle to produce the correct report for each user.

I did many test using the option evaluate or value is in the filter unsuccessfully. The task execution produced errors like

Failed generation of report 56d8b5cc-1727-4e2d-bb5f-3591a0a02fdf for user 479c6e3c-4a2d-4ebd-851d-a85181320888. ERROR: Cannot apply filter Filters: [Fields: [Name: F\% ID Aderente, ConnectionId: 79f01d2a-c1be-41ac-8d9e-7a139124634e, Values: [Evaluate:[% ID Aderente Excel]={"=[% ID Aderente]=[% ID Aderente Excel]"}], Override: False, Void: False], Void: False], Bookmark: , Void: False to current document data. Requested fields with evaluates are: F\% ID Aderente 

I apoligize if I was not clear on the goal.

Any advice?

Nicola

JonnyPoole
Employee
Employee

Are the different reports from different report templates ? Or the same templates ? 

-  You can update the members of an NPrinting group , create filters and associate filters to users programmatically, and loop through multiple task executions changing the group members and filters in each loop .  But its still just one report template.

- you can't change reports associated to a task, but you can write a report that conditionally includes elements of the reports.  

So if its the same report template there is an automated way.  If there are limited numbers of reports you could also just create a limited number of tasks each using one of the reports.  Or if the report content must change in a more dynamic way you can try a report template that conditional includes/excludes pieces

npapapicco
Partner - Contributor III
Partner - Contributor III
Author

The report template is the same for all users, content depends on the value of the dashboard field we are cycling on in the report. I can import users with associated group and filter from excel file and that works. But I have a different filter for different users

But, what I am tryng to do is to use a formula or an expression for the filter associated to users so that I can use a single filter for all users and the filter were evaluated depending on a field or variable during the report cycle in a single task.

I apologize if I was not clear.

Thank you

  

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

What you are trying to do will not work. The approach with individual user filters is the only way. 

As an alternative you can use section access

cheers Lech, 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 to the problem.
JonnyPoole
Employee
Employee

As @Lech_Miszkiewicz   mentions , user filters are the only way.  

I'm checking to see if/when we may support 'Variable Filters' again in NPrinting. Not today but i thought i saw that coming. No promises: ) 

Can you evaluate the expression in the load script ?  

If yes, consider looping through a user/filter list in a Qlik load script. With each loop, evaluate if the expression/condtion is true/false, then update an NP Group with the user and update the user with the users filter and then run a task execution. Repeat for other combinations.  

Here is a sample presented at Qonnections 2019 . Its definitely more technical and requires strong skills with the Qlik script. But if you have a mandate to deliver a solution, this uses Qlik tooling to do this in a way that is supported. You would just be responsible for how you code your Qlik script. 

https://community.qlik.com/t5/Qlik-NPrinting-Documents/Send-out-multiple-emails-for-a-single-Publish...