Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

problem PDF printing PDF-Xchange 3.0

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

1 Solution

Accepted Solutions
marcus_sommer

Also other things like mail runs with the parameter /l better. To quit the application:

rem ** quit QlikView **

ActiveDocument.GetApplication.Quit

- Marcus

View solution in original post

4 Replies
marcus_sommer

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

Not applicable
Author

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


marcus_sommer

Also other things like mail runs with the parameter /l better. To quit the application:

rem ** quit QlikView **

ActiveDocument.GetApplication.Quit

- Marcus

Not applicable
Author

Marcus,

The "ActiveDocument.GetApplication.Quit'-trick solves all my problems .

Thanks,

Gerrit