12 Replies Latest reply: Nov 3, 2011 11:28 AM by Christian Ovalle RSS

    Auto re-load a QVW

    clodge

      The following scheduled task command results in a task that will run when user QlikView is logged on and will not when they aren't

      schtasks /create /RU QlikView /RP *password* /SC HOURLY /ST 13:15 /TN Qv_Refresh_Rentals_16 /TR "C:\Documents and Settings\QlikView\My Documents\QlikView Commands\Rentals_16_Development.cmd"

      Is there any way to run a qvw re-load\refresh without having a user session running on the server?

      Thanks

        • Auto re-load a QVW
          Rakesh Mehta

          Wy don't you just schedule cmd (or batch or vbs or ....) file directly in Windows scheduler, or in QV Publisher standard, or in some 3rd party tool?

            • Auto re-load a QVW
              clodge

              Hi, thanks for the quick response. That's what I have done, created a task in Windows Scheduler. But is requires a logged in user session to run.

              What I want to achieve, either by a remote command or scheduled task, is to auto refresh the qvw without needing to have a user session running on the server.

              Is this possible?

                • Auto re-load a QVW

                  If I understand, you want to automate the reload with a Qlikview application, not the server

                  In this case, the easiest way is to run a batch such as Qv.exe /r xxxxx.qvw.

                  You can add the batch in the scheduled task but you need to change the default user which will run the batch ( use the usual user logged on the machine) . This should work.

                  Rgds,

                  Sébastien

                    • Auto re-load a QVW
                      clodge

                      Thanks spastor. I believe the problem is sorted now given your answer. It was actually a problem running cmd.exe.

                      The reason I was getting problems is to do with permissions. In the course of trying to figure out what was going on I have discovered that Windows has some 'magic' user groups - one being INTERACTIVE, another being BATCH.

                      It turns out that by default, C:\Windows\System32\cmd.exe has Read & Execute permissions set for Adminstrators and INTERACTIVE by default (no BATCH).

                      Therefore - I think that anybody out there who is NOT getting a problem running QlikView as a scheduled task is running that task using an Administrative logon which is what I was trying to avoid.

                      Thanks for all your help.

                        • Auto re-load a QVW
                          Stephen Charles

                          Take a look at PsExec (google it). We use it with the follow syntax in a bat file that we schedule to run at night.

                          psexec -u "GroupMemberName" -p "Password" "C:\Program Files (x86)\QlikView\qv.exe
                          -r "Path and Name of QlikView document"

                           

                          Stephen

                            • Auto re-load a QVW
                              clodge

                              Thanks Stephen, this looks interesting and useful.

                              Much appreciated.

                                • AW:Re: Auto re-load a QVW
                                  Reiner Kräutle

                                  You can use VB-Script to reload your QVW - look at this sample:

                                   


                                  Option Explicit
                                  Dim qv ' As QlikTech.QlikView
                                  Dim qvDoc ' As QlikView.Document
                                  ' open QlikView application
                                  Set qv = CreateObject("QlikTech.QlikView")
                                  ' open QlikView Document
                                  Set qvDoc = qv.OpenDoc("c:\test\test.qvw")
                                  ' reload data
                                  qvDoc.ReloadEx 2,1 ' 2=ignore Errors; 1=hide process dialog
                                  ' save and close document
                                  qvDoc.save
                                  qvDoc.CloseDoc
                                  ' quit QlikView
                                  qv.Quit
                                  Set qvDoc = Nothing
                                  Set qv = Nothing


                                    • AW:Re: Auto re-load a QVW
                                      Mahasweta

                                      Hi,

                                      I have some similar issue ,will you please help me out.

                                      I need to reload my QV doc aotumatically after the section access implemnted.

                                      What i mean here ,the data should be reloaded automatically according to the user access, and the user should not see the extra data which he dose not have access.

                                      Specifically teh user should get the refreshed data.

                                      i wrote in my macro as "activedocument.reload" but the same is working only when the admin loggs in ,but its not relaoding for the users.

                                      Could you please tell me what i am missing?

                                      Thanks,

                                      Mahasweta

                                        • AW:Re: Auto re-load a QVW
                                          Mahasweta

                                          Hi,

                                          Just to add something to my doubts.

                                          1- What is the ideal way to reload a document, is it through VB script and through the sceduler.

                                          2- will the script reload the document every time we open the same or it will reload only when there is some change in back end data?

                                          Thanks & regards,

                                          Mahasweta

                                            • AW:Re: Auto re-load a QVW
                                              Miles Simpson

                                              Just an FYI that we run our batch each morning with a batch script running via Windows Scheduled tasks. Seems to work find.

                                              As an extension to the original question, I'm curious if anyone has triggered reloads remotely? For example with a standalone scheduler app on a remote server.

                                                • AW:Re: Auto re-load a QVW
                                                  Miles Simpson

                                                   


                                                  Miles Simpson wrote:
                                                  Just an FYI that we run our batch each morning with a batch script running via Windows Scheduled tasks. Seems to work find.

                                                  As an extension to the original question, I'm curious if anyone has triggered reloads remotely? For example with a standalone scheduler app on a remote server. <div></div>


                                                  Oops... "Seems to work fine" :-)

                              • AW:Re: Auto re-load a QVW

                                Estimados espero les sirva encontre una manera de hacer el Reload mas rapido y no dentro del servidor. Desde el Editor.

                                 

                                Prueben esto.

                                 

                                Crean una variable:

                                minute(now()) = Recarga cada minuto

                                Hour(now()) = Recarga cada hora

                                 

                                vrecarga = minute(now())

                                 

                                Crean la Macro con el Reload.

                                Colocal esto:

                                 

                                'AutoRecarga Documento

                                sub autoreload

                                activeDocument.reload

                                end sub

                                 

                                 

                                Luego van a la opcion.

                                 

                                Configuración - Propiedades del Documento y luego Disparadores

                                Crear un procedimiento de Evento de Variable.

                                Seleccionan la Variable que creamos "vrecarga" y pinchan "Añadir Acción"

                                Seleccionan Tipo de acción "externo" - Luego Ejecutar Macro

                                Colocan autoreload en el nombre de la macro y guardan.

                                 

                                Eso es todo cada un minuto ejecutara la macro cuando cambie al variable.

                                 

                                No he encontrado la manera de quitar la ventana de recarga, esa que aparece cuando le das manualmente el Reload.

                                 

                                Espero les sirva, si tienen problemas me avisan.