2 Replies Latest reply: Jan 28, 2010 4:36 AM by Andreas Karlsson RSS

    How to trig reload in Publisher?

    Andreas Karlsson

      Hi folks,

      I've a qvw which is reloaded periodically in Publisher. Now I want to change the reloading of this file.

      The qvw reads an external .txt file and in the perfect world the reload task should only be done if this file is resaved.

      But a solution where the user in some way trigs a reload is ok. Perhaps a button in the qvw. Macro?

      I've read about the EDX but cannot get it working. On the server there is Qlikview 7 and Publisher 4.1.0 standard edition.



        • How to trig reload in Publisher?

          Upgrade to ver 8.5 or ver 9, there you may execute an EDX from an application button using an XML HTTP request.

            • How to trig reload in Publisher?
              Andreas Karlsson


              Well I just wrote a macro that is trigged from a button in the UI. The macro performs the reload when the user press it.


              Here is the macro if anyone is interested...


              sub reload_task

              set var1=ActiveDocument.GetVariable("ControlDirectory")

              fileName=var1.GetContent.string & "RR_Qlikview_trig_omladdning.TXT"

              'Dim sCurPath
              'sCurPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
              'msgbox sCurPath

              Const ForReading = 1
              Set objFSO = CreateObject("Scripting.FileSystemObject")
              ' fileName="K:\Qlikview\LOTS\RR_Filer\Control\RR_Qlikview_trig_omladdning.TXT"
              If objFSO.FileExists(fileName) Then
              Set objTextFile = objFSO.OpenTextFile(fileName, ForReading)
              Dim row
              Do Until objTextFile.AtEndOfStream
              strNextLine = objTextFile.Readline
              arrServiceList = Split(strNextLine , "=")
              For i = 1 to Ubound(arrServiceList)
              if row=2 Then
              ElseIf row=3 Then
              End If

              YesNo = MsgBox("Du är på väg att ladda om data för ÅR-PERIOD:"& AR&"-"&PERIOD&" (Angivet i 'RR_Qlikview_trig_omladdning.TXT') OK?",vbYesNo + vbQuestion,"Är du riktigt säker?")

              Select Case YesNo
              Case vbYes
              ActiveDocument.ReloadEx 2,0
              Case vbNo

              End Select


              msgbox "Kunde inte hitta filen 'RR_Qlikview_trig_omladdning.TXT'. Letade här: "&fileName

              End If

              end sub