14 Replies Latest reply: Jan 19, 2017 3:14 AM by Marcus Sommer RSS

    To reload qvw using  batch file

    Nadaz N

      I am manually reloading and saving my qvw file with particular credentials. Please let me know so as how to incorporate the username and credentials in the batch file so that i can schedule a task with the windows scheduler. I am getting the below error. Kindly help.

      error.png

        • Re: To reload qvw using  batch file
          Marcus Sommer

          I think you had a problem with the number of allowed recoverings within the personal edition. Without a valid licence you couldn't use different users to open/reload qlikview applications. For more see here: Personal Edition FAQs.

           

          - Marcus

            • Re: To reload qvw using  batch file
              Nadaz N

              Hi Marcus,

               

              Thanks for the reply. We do have a valid license.We license it by accessing a particular URL and enter our credentials. Open the required document, reload and save it manually. I am trying to reload the particular document from QV server with another user's credentials. Now, i am not sure how to give the licensing user's credentials in the batch file which has to run in the QV server.

               

                • Re: To reload qvw using  batch file
                  Marcus Sommer

                  There are several ways thinkable. One would be to use a vbs-batch for it like: Re: Vbs - passing parameters to opendoc or opendocex which includes options to specify a user+password - for more details take a look within the APIGuide.qvw - and also this one might be useful: Re: QlikView vbs open doc in new window.

                   

                  Another option is to use an intermediate RUNAS batch to start the origin batch. See here what is meant: https://www.windows-commandline.com/windows-runas-command-prompt/.

                   

                  A further possibility is to use windows tasks which provides also the possibility to be run with a certain user - how to trigger it with qlikview see here: Re: Macro to move file to another folder.

                   

                  You might also need to combine some of the above suggestions. Personally I use quite often an EXECUTE statement within an application to run a windows task which then runs the batch.

                   

                  - Marcus

                    • Re: To reload qvw using  batch file
                      Nadaz N

                      Hi Marcus,

                       

                      I have been trying out the solutions which you provided but i don't know exactly where i am going wrong and then i finally zeroed in to use the batch file and schedule it in the task scheduler and here is my batch script. This also din't complete my task of reloading.

                      "C:\Program Files\QlikView\qv.exe http://*****/login.htm"  -batch -b -pw password username /R "\\shared path folder\test.QVW"

                       

                      For me to license it , i have to access this URL http://*****/login.htm and then type in my password and username.

                        • Re: To reload qvw using  batch file
                          Marcus Sommer

                          I think you couldn't open a qvw with a certain user directly with a command-line statement because those parameter aren't available only the reload-type, closing + saving by reload, with(out) data/security and the specifying of variables are possible.

                           

                          Take a closer look on the RUNAS link from above. RUNAS meant to use an intermediated step by running a start-batch which includes a user and a password and this batch starts then your qvw with these user-credentials. And of course this user must have a valid licence at this time.

                           

                          - Marcus

                            • Re: To reload qvw using  batch file
                              Nadaz N

                              Marcus, I was wondering how to take care of the URL because i have to access that and then enter my credentials.

                                • Re: To reload qvw using  batch file
                                  Marcus Sommer

                                  I must admit that I couldn't quite follow your approach. I assume you want to lease a licence from the server but ...

                                   

                                  Please elaborate in more detail what do you are trying to achieve - order of steps, the specific aim for each of them and how do you want to execute each of these steps.

                                   

                                  - Marcus

                                    • Re: To reload qvw using  batch file
                                      Nadaz N

                                      Okay. I will give an idea about what i am doing and about what i am trying to do.

                                      We have a shared path where all the qvw files are located. And i have to reload each of these files on a daily and weekly basis.

                                      Currently, to reload each qvw file what I do is :

                                      1)Open my Qlikview Personal Edition. License it by accessing a particular URL. Will have to give a particular user's credentials over there.

                                      2)And here my documents will be displayed . I will have to chose the document which i have to reload. I open it, reload it and then save it in the same shared folder.

                                      Now, i have to automate this reloading qvw docs and trying to figure out a solution for the same.

                                       

                                      The Qlikview server is mounted separately with some other user's credentials.

                                       

                                      Hope you got an idea about this.

                                       

                                      Thanks Marcus

                                        • Re: To reload qvw using  batch file
                                          Marcus Sommer

                                          Normally you should have a leased licence for 30 days which meant this wouldn't be a daily task. Do I understand it right that you opened within the desktop client the access point, then downloaded respectively opened the qvw's and reload them and afterwards you stored the files by overwriting the original qvw, right?

                                           

                                          Beside them I think the easiest way to automate the reloads will be to use the server for it. Within the qmc you could easily specify such daily/weekly reload-tasks.

                                           

                                          - Marcus

                                            • Re: To reload qvw using  batch file
                                              Nadaz N

                                              Yes Marcus. You are right, we overwrite the original qvw. And I did try to automate the reloads from the server.In the qmc i had enabled the reload task on a daily basis and i found that  my qvw's meta file in the shared folder was updated i.e.,i noticed the date but the particular qlikview document wasn't updated.Does this mean that the file got reloaded? I am not sure about this.

                                              So I had reload it manually again and then 'Encountered a sharing violation while accessing the document' error popped up. I went to my server and killed the tasks (taskkill /im qv.exe /F) after which i could overwrite my document without any issues.

                                                • Re: To reload qvw using  batch file
                                                  Marcus Sommer

                                                  Hmm ... something isn't right. Then if you trigger a task within the qmc the qvb.exe would do the reload-job and not the qv.exe. Also you should see within the task-overview that a tasks failed and you should get an error-message for it - I hope you had configured the mail-options to your mailserver and mail-address and further also enabled the script-log within each qvw (in document properties in tab general).

                                                   

                                                  This meant you should get a message, see the task-status within the qmc, could access there the task-log and you could further take a look within the script-log - to see what has happens and what's going wrong.

                                                   

                                                  Further you need to consider that quite probably the server services will run with a different user to yours and might not have the appropriate access rights to this shared folder or to access any databases. The easiest way to check would be to login on the server with the server-account and reload there with the desktop-client your applications. Now you will see quite directly if it worked or not and if not why - that's easier then to grab these informations from the log-files.

                                                   

                                                  - Marcus

                              • Re: To reload qvw using  batch file
                                Krishnapriya Arumugam

                                Hi,

                                 

                                As insisted by Marcus, this the problem with your personal edition. You need a valid license to reload the application.

                                 

                                Even if you reload a application using batch script, the qvw file will be opened in background. So the user who executes the batch should Open the file then reload.

                                Please apply the License key in the machine to solve this issue.