6 Replies Latest reply: Aug 23, 2013 4:46 AM by Srinivasan R RSS

    Running a macro before a reload from the server

    phersan_axis

      Hi everyone,

      Here is my problem: I have a QVW which contains a macro that will fetch data from an internet file. After that macro runs, I need it to reload the document and save it. I do not want to use an OnOpen trigger or anything like that to kick off the macro, I just want to schedule a job to do it. Is there any preReload() function or anything similar? I am pretty experienced with the QV Desktop application, but I am new to the Server.

      Thanks in advance for the help.

        • Running a macro before a reload from the server
          phersan_axis

          I guess I could create a dummy QVW file with a blank script. And that file would reload nothing then run the macro with an OnPostReload trigger. Then have my application run after that one is done.

          Is there a smarter, more efficient way to go about doing this?

            • Running a macro before a reload from the server
              Gordon Savage

              That is certainly an option. So it sounds like the data is being fetched and stored locally? Can it not be fetched dynamically in the load script ? Dont forget that if you reference a subroutine/function within the load script that isnt 'native' Qlikview it will look for a document macro and execute it if it finds it.

              Regards,

              Gordon

                • Running a macro before a reload from the server
                  phersan_axis

                  Sorry for the poor explanation. The data isn't actually being fetched by the macro, or else I would load it in the script like you suggested. What the macro does is: it queries a website, and this website has a server that dynamically produces a txt file. The macro returns the LOCATION of the txt file as a VARIABLE, which is then used in my load statement to load the data. So that txt file is actually only being created when my macro runs, and then telling me where the file is.

                   

                  So I need the macro to run in order to get the location of the data before the script runs.

                   

                  Any ideas?