Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I reduce data by QlikView OCX every day for different customers on server.Sometime it works good.But sometime It does its job unsuccessfully.Usually it will be no-response for long time,but not give me some error message.
Who can give me some advice ,thanks a lot.
hello,
if you reduce data within loops, I recommend adding this before each reduction :
status=Document.GetApplication.WaitForIdle
Document.GetApplication.Refresh
the waitforidle allows an optional timeout, if timeout is reached status will return false (means that QV is anormaly busy)
hope this helps.
I guess that you maybe should check the max number of QlikView engines running. This could possibly have an effekt. I'm doing the same thing but currently I'm running the OCX jobs on a seperate server.
This was however mostly because of the frequent reloads of the data.
Thanks yves . I will try it.
To yvey,
I search the WaitForIdle in API guide. I think that it is for macro execution , not for OCX.
To Torben Seebach,
I think that the max number of QlikView engines running is based on system resource.If the CPU and RAM of your machine is big enough, I think it will work good.
I found that when another 'fat' application start ,my reducing data OCX application maybe have trouble.Need I update my machine hardware?
Hello,
For me, OCX data reduction is a little bit far now (some work done 5 years ago...).
In API Guide, OCX section describe OCX specific instruction, but all other automation members are also valid for OCX (as written in red bold on top of sheet), like the Document.ReduceData that you certainly use. I think you can access QV application object thru :
Set QVapp = QlikOcx1.ActiveDocument.GetApplication()
you can try i.e. : QlikOcx1.ActiveDocument.GetApplication.MsgBox("Hello world")
The QV application object can help you debug as it provides methods to get Memory information, CPU usage, ...
A while back I was programming Linux server caching, I used to set a lockfile to keep track of the number of running instances. I used "touch" to create the lockfile in /tmp and then remove the read lock when I was done. To se if the file was in use I used Flock() and then made the next instance sleep until the lock was released.
I know that vb.net supports similar functions, although I have not yet added this feature to my reduce scripts.
Can you identify which part of the process that fails? If its a file lock issue, then you properly just could make a copy of the qvw, and then reduce the copy instead?
OK, for all of you,
First thanks for your patient help,
Then list my solution and part of code source, may you give me some advice?
I develop app by using Qlikview 8.0 activeX control in VS2005 ,and release on window sever 2003.
part of c# code source ,
Doc qvDoc = axQlikOCX.OpenDocument(qvwFileName);
qvDoc.Reload(0);
qvDoc.SaveAs(qvwFileName, 8);
//***********loop for different user****start*************
qvDoc = this.axQlikOCX.OpenDocument(qvwFileName);
Field qvField = qvDoc.Fields(fieldName);
......
qvField.SelectValues(arrValues, false, false);
qvDoc.ReduceData(false, null);
qvDoc.SaveAs(qvwFileName, 8);
//****************************************end***********
Some time the 'Bold font' parts maybe no-response .Normally one action will finish in 10-20minutes.I have 6 qvw files to reduce.Sometime it run several hours...
I try 'WaitforIdle' method, but the result is not expected.
Something wrong with it?
I would replace Reload by a ReloadEx to suppress progress dialog and check error count returned, this is how Ocx is (or was) used by Publisher to reload documents.
Last, as Ocx is a displayed control, it would be safer to insert statement for windows events (I think it is System.Windows.Forms.Application.DoEvents).