I wish to automatically print a pdf document that will be then emailed using another process/application to our sales force. (For the interested, the 'other application' we use is TaskCentre.)
The printout should be run after the last reload of the day. (our server is set to reload every 30 minutes and the last reload is at 11:30 PM)
I have set some script that is triggered after OnPostReload. The trigger activates a macro that checks if the time is after 11:30 PM. If yes, it calls another macro/function which prints the report using Acrobat Distiller and saves it in a prescribed location.
When reloading manually, the process runs like a charm. Reloads>OnPostReload trigger is fired and the report is printed out nicely.
Here is the challenge:
According to QlikView Reference Manual it is impossible to trigger OnPostReload action from a server's load process (Book II Part III 29.3.)
So I thought that I could start my local application remotely (from a VBA calling a shell process) Doing so with the appropriate command line flags the application can be started:
a = Shell("C:\Program Files\QlikView\qv.exe /NoSecurity /R C:\MyApplication.qvw")
("/NoSecurity" bypasses the need to confirm start with macros and "/R" tells the application start with a reload)
All works well. The application starts in the background, the load starts and finishes but the printout does not occur.
Does anyone know why or is there a better way to achieve what I am trying to do.
I was not aware of the product and could not find any references to it in QlikView.com.
Can it be set to run on schedule or does it still need human intervention? We have many such automatic processes that are generated mainly by TaskCentre but the one I described cannot be done by this application
Macros set to trigger on PostReload event will not be triggered when you reload via batch file but will be run when it is manual.
So after the reloead completed via batch file, you can have a VBS file that can open the QVW application which is just reloaded and access a button which calls the macro and press the button using the syntax