Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Batch reload issue in Qlikview 10

As is commonly known, the OnPostReload event doesn't trigger after a reload on the server, so there are other solutions to get Qlikview to auto-generate emails or spreadsheets, including creating batch files.

GIven that qv.exe / r <filename> in a batch file is hit and miss at best (i.e. sometimes it works, sometimes it doesn't), I have gone for a vbscript solution, which is triggered by a scheduled task on the server. This solution was suggested by a previous post. Another advantage of using a button press through vbscript rather than OnPostReload is that you can reload your doc whenever you want during development without having to bother to disable the event all the time (in my case, the underlying macro fires off a load of emails to various people, so clearly I don't want this to happen every time I test changes to the app).

That's the background. The problem I have is as follows. The vbscript that is supposed to launch every day is this:

Set MyApp = CreateObject("QlikTech.QlikView")
Set MyDoc = MyApp.OpenDoc ("d:\qvapps\live\docnames.qvw","","")
Set ActiveDocument = MyDoc
ActiveDocument.GetSheetObject("BU02").Press
wscript.sleep 15000
Set MyDoc = Nothing
MyApp.Quit
Set MyApp = Nothing

About 3 times out of 10, the script works. The rest of the time, I get this message box pop up on the server.

error loading image

None of our apps have ever been near the Personal Edition and I am not using Qlikview Personal Edition. Indeed, after I click Abort on the above dialog box, a pop up says "Document failed to load", then Qlikview launches: as normal, with full leased license etc.

Could somebody please suggest either a fix or workaround to the above, which I believe is a bug, or a more reliable way of running batch reloads that doesn't involved qv.exe /r ?

As an aside, I know QV 10 is in its initial release but does it seem much buggier to you than version 9? That is my experience so far.

With thanks as always
James

1 Solution

Accepted Solutions
Not applicable
Author

Kristoffer, thanks for your reply.

I do have a local developer license for Desktop installed on the server that hosts Qlikview.

I have continued to play around with this problem today and after some testing, have found a workaround that, although far from ideal, appears to work.

My suspicion is that because the vbscript runs asynchronously (i.e. it doesn't wait for one line to finish before it starts on the next), the error probably pops up when lines 1 and 2 of the script are executed simultaneously. The fact that sometimes it works and sometimes it doesn't would support this theory, particularly as it tends to fail on the first load, the works on the second (the first load is typically slower).

By inserting wscript.sleep 3000 after line 1, this gives the application 3 seconds to load before then assigning the document to the object and opening the document. Having run the script 20 times just now, I have not had any errors so far, so fingers crossed this has done the trick.

Not sure whether I would class this as a Qlikview bug, or a limitation of using an asychronous script to launch the application, (or both!). To be absolutely safe, going forward, I might make it my practise to insert a sleep command of a couple of seconds in between every command so the script doesn't get ahead of itself.

Interested in your thoughts.

Thanks
James

View solution in original post

4 Replies
Not applicable
Author

This absolutely looks like a bug.

Do you have the possibility to test the script with a local Developer/Desktop license installed? This problem is most likely related to the initialization of the leased license.

martinpohl
Partner - Master
Partner - Master

we also know this problem.

It seems to appear if the applicaton get opened by another person or another computer. The other effect is if your account uses morer than 2 licenses (e.g on a desktop, on a laptop and on a server). You only can own two licences at the time.

Always run is to open QlikView, open document.

Regards

Not applicable
Author

Kristoffer, thanks for your reply.

I do have a local developer license for Desktop installed on the server that hosts Qlikview.

I have continued to play around with this problem today and after some testing, have found a workaround that, although far from ideal, appears to work.

My suspicion is that because the vbscript runs asynchronously (i.e. it doesn't wait for one line to finish before it starts on the next), the error probably pops up when lines 1 and 2 of the script are executed simultaneously. The fact that sometimes it works and sometimes it doesn't would support this theory, particularly as it tends to fail on the first load, the works on the second (the first load is typically slower).

By inserting wscript.sleep 3000 after line 1, this gives the application 3 seconds to load before then assigning the document to the object and opening the document. Having run the script 20 times just now, I have not had any errors so far, so fingers crossed this has done the trick.

Not sure whether I would class this as a Qlikview bug, or a limitation of using an asychronous script to launch the application, (or both!). To be absolutely safe, going forward, I might make it my practise to insert a sleep command of a couple of seconds in between every command so the script doesn't get ahead of itself.

Interested in your thoughts.

Thanks
James

Not applicable
Author

Thanks Martin.

This isn't the case for me as I am the only person using the application at present. However, I will bear this in mind as we roll out to more users.

James