6 Replies Latest reply: Sep 16, 2011 11:02 AM by Josh Duenyas RSS

    A challenge

    Josh Duenyas

      I have a challenge:

      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:

       

      Dim a

      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.

       

      Thanks to all