Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a weird problem.
I have the following OnPostReload macro defined and it works fine when I do a reload from the QV client.
Example 1:
Sub printRP
ActiveDocument.GetApplication.WaitForIdle(1000)
ActiveDocument.PrintReport "RP01", "PDF-XChange 3.0", false
ActiveDocument.GetApplication.Sleep 1000
ActiveDocument.PrintReport "RP02", "PDF-XChange 3.0", false
ActiveDocument.GetApplication.Sleep 1000
End Sub
After reload QV prints 2 reports with 2 different filenames (save setting Xchange %[DocName] %[Time]).
However when I start the qvw with this macro from the command prompt line nothing is saved.
"C:\Program Files\QlikView\qv.exe" /r "D:\Qlikviewdata\mr.qvw"
But once I alter the macro and take out one of the two printreport lines it works fine again and the file is printed and saved.
So the following works also fine from the command prompt.
Example 2.
Sub printRP
ActiveDocument.GetApplication.WaitForIdle(1000)
ActiveDocument.PrintReport "RP01", "PDF-XChange 3.0", false
ActiveDocument.GetApplication.Sleep 1000
End Sub
So both examples work after a reload when I use the QV client but only example 2 works when i do a reload from the command line.
Any idea how I can have multiple reports printed from the command line?
Thanks in advance.
Gerrit
Also other things like mail runs with the parameter /l better. To quit the application:
rem ** quit QlikView **
ActiveDocument.GetApplication.Quit
- Marcus
Perhaps the sleep interval is too short. I use in similar cases often .sleep 4000 to ensure the previous print the really saved before the next print start.
- Marcus
Marcus,
I tried that but the same result.
Strange behaviour is also thet the qv.exe process keeps hanging in the task manager.
I just found out that the /l option does the trick however that task leaves the qvw open.
I am going to try to build my solution with the /l option and do a taskkill at the end.
Gerrit
Also other things like mail runs with the parameter /l better. To quit the application:
rem ** quit QlikView **
ActiveDocument.GetApplication.Quit
- Marcus
Marcus,
The "ActiveDocument.GetApplication.Quit'-trick solves all my problems .
Thanks,
Gerrit