Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Creating a VBScript for EDX

Hi All,

I am very new to QlickView, I have vast experience in using Business Objects but this is my first assignment with QlikView. We are upgrading to QV11 and one of the hurdles I am facing is to update the report "Reload" button which executes a "Task" in QV10. Apparently from reading blogs and community articles I have realized that there are a few .NET C# based resolutions; however in my case we don't want to use that route. So any pointers or any guide with this would be really helpful.

Regards,

Nitin

43 Replies
Not applicable
Author

Okk, now I understand your Use Case. In my case we want to trigger a Task from a report and that task can trigger a .bat file. That's the reason I have kept my QMSEDX.exe in the server and trying to execute it from a report. One thing that I have learned is that probably the location of the my file is not correct. Let me put that under Source Documents.

I see you want to trigger a Task that is defined in the .bat file. How (what mechanism) are you planning to trigger the .bat file?

Not applicable
Author

I am going to use an external scheduling system that can be used to schedule any sort of job, UNIX, java, etc.

After our batch jobs are done early in the morning, the external scheduler will send a signal to the .bat file to execute it, thus kicking off the Qlikview Publisher job associated with the QVD's that contain data from the batch jobs.

My main purpose behind this isnt to refresh QVW's but to sync QVD refreshes off of batch jobs.

Not applicable
Author

You may want to approach this differently. I believe you may be able to just specify the name of the QVW you want to refresh in this situation. You don't need to involve the scheduler at all.

Just try the QVW name and no password. See if that works.

Not applicable
Author

I got it... Our main purpose here is to have a refresh on Demand kind of feature, so a user can refresh a document on its own willor execute a task on its own will. I am not too sure why QlikView has made this so complicated.

Not applicable
Author

Did just the QVW name work for you?

Come the time this is resolved, please make sure you mark correct/helpful answers as I've seen questions about EDX happening daily on the community. It will help everyone else out.

Not applicable
Author

No it didn't work. I am running out of options and I think I might have to go the API route, writing one in .NET seems to be the only possible way to me.

fosuzuki
Partner - Specialist III
Partner - Specialist III

Hi Nitin,

I used the EDX in a QVW's on-demand reload by a click in a button in the same QVW's interface. This is what you also need right? It seems that you are almost there, don't give up... I also almost gave up trying to make it work..

Here is the code I got working in my qvw (it seems that yours is ok...):

function RequestEDX(sEDXTask)

          dim strServer

          dim strTaskName

          dim strCommand

          dim strReturnValue

          strServer = "http://servername:4799/QMS/Service"

          strTaskName = sEDXTask

          strCommand = "\\servername\QMSEDX_CommandLine\qmsedx.exe" & _

                                        " -qms=" & chr(34) & strServer & chr(34) & _

                                        " -task=" & chr(34) & strTaskName & chr(34) & _

                                        " -password=xxxxx" & _

                                        " -timeout=600"

          Set WshShell = CreateObject("WScript.Shell")

          strReturnValue = WshShell.Run (strCommand, 0, true)

      RequestEDX = strReturnValue

end function

Oh, do you have the QMSEDX.exe.config file in the same folder as the QMSEDX.exe file? This is important. This file comes in the same package of the exe file. You have to edit this QMSEDX.exe.config file and insert your server's name:

        <client>

            <endpoint address="http://yourservername:4799/QMS/Service" binding="basicHttpBinding"

                bindingConfiguration="BasicHttpBinding_IQMS" contract="QMSAPI.IQMS"

                name="BasicHttpBinding_IQMS"/>

            <endpoint address="http://yourservername:4799/ANY/Service" binding="basicHttpBinding"

                bindingConfiguration="BasicHttpBinding_IQTService" contract="QMSAPI.IQTService"

                name="BasicHttpBinding_IQTService" />

        </client>

These are the steps I'd recommend you doing/checking:

1. Ensure that the EDX trigger is working locally in the server. It seems that you already got this right?

2. Share the folder containing the QMSEDX.exe file, granting permission to the users that will have this EDX reload mechanism

3. In the client machine, try to map the the server's shared folder to check if it is accessible by the current user

4. Create a .bat file with the command line, referencing the QMSEDX.exe file in the server's shared folder, run it in the client machine, and check if the task was triggered

5. In the QVW, go to the macro module and select the 'System Access' options.

6. In the server, go to System > Setup > QVServer > Security > Allow unsafe macro execution on server

7. In the client's IE, go to Tools > Internet Options > Security > Local Intranet > Sites > Advanced > Add the website to the zone > Insert your server's path (http://servername/qlikview).

8. Clear the Browser's history

9. When navigating in the QVW with IE, type CTRL+SHIFT+M and select the System Access option.

Well, I'll wait for your feedback and if it still not works, I'll try to remember if I missed something...

Fernando

Not applicable
Author

Hi Fernando,

Thanks for the encouraging words and sharing your expertise over this matter. I tried everything that you mentioned and was still not able to get it running; hence I started to peel off all the layers involved in the entire solution and realized that the port 4799 needs to be opened and listening, in my case although the port was open on the server, it was not listening any requests made to it. Hence I had to enable port 4799 to be able to receive and listen to any new requests/calls made to it.

Once I was able to do "telnet" from my machine on port 4799 on my server, I was successfully able to execute QMSEDX.exe from my PC

Nitin

fosuzuki
Partner - Specialist III
Partner - Specialist III

Great Nitin! Glad I could help you, though you fund the solution by yourself...

Regards

Fernando

Not applicable
Author

Hi,

I too am trying something with manual reload, with partial success. My problem statement is related to the next step after reload.

Possibly, someone could help me out here.

This is what I want to achieve: Trigger reload on button click on server. After reload finishes, a msgbox should appear indicating status, and also qvw document should be refreshed , so that the effect is immediately visible, without the user having to do a manual refresh.

This is how I went about solving the first issue: 'reload on button click'

I use qlikview version 9, which does not have qmsedx.exe..,so using edx is slightly different, I guess.

But, it didn't work and another method gave me the results.

So, this is what finally worked for me:

I wrote a macro:

Sub External2

    Set WshShell = CreateObject("WScript.Shell")

    Command="D:\testserver.bat"

    status=WshShell.Run(Command,0,1)

    if(status=0) then

        WshShell.Popup "Reload Completed"

    end if

    ActiveDocument.SetClearState

End Sub

where the content of server.bat is

    
"C:\Program Files\QlikView\Publisher\Distribution Service\QlikviewDistributionService.exe" -r="C:\QlikViewMount\RN60-ConsolidatedCostofProgrammingReport.qvw"

My problem is in IE,while  calling the macro on button click , the server times out(though reload happens and I have to open the doc again)..I believe it is becaue of the run command WshShell.Run(Command,0,1)

if I give msgbox "Reload Completed" instead of  WshShell.Popup , the reload happens and server does not timeout, but, the msgbox is not displayed and also

ActiveDocument.SetClearState is not executed and I have to refresh the document manually to see the changes.


I tried Wscript.Sleep method, but qlikview gave me 'Wscript object not found' error.

Is there any way I can solve this?

Thanks and Regards,

Anju