Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Qlikview PDF in 9

Hi, All

As i noticed that Qlikview 9.0 server installation includes 'PDF-Xchange 3', does it mean that we don't have to use Qlikview PDF for pdf printing in future?

Our current approach is to use macro to print pdf when the qv reloads the scripts.

If we are going to use 'PDF-Xchange 3', how are we going to do the automated pdf printing?

I am now confused whether i should continue to use the earlier Qlikview PDF way for automated report printing or i should switch to the new pdf tool?

Anybody has experienced this already?

Best Regards

Mingming

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

I just found out that bullzippdf is quite good and providing great compatibility to the latest qlikview applications.

Here is the code used for pdf generation. You may find the bullzippdf online + ghost script, i will not provide url here.

Sub printPDF

vReport = "RP01" 'Set report

vName = "myReport" 'Name of output pdf

ActiveDocument.PrintReport(vReport), "Bullzip PDF Printer", false 'Printreport

reportFile = ReportFolder & vName &".pdf" 'Setting outputname

MyPrintPDFWithBullZip(reportFile) 'Call pdf printer

End sub



FUNCTION MyPrintPDFWithBullZip (pdfOutputFile)

set obj = CreateObject("Bullzip.PDFPrinterSettings")
obj.SetValue "Output" , pdfOutputFile
obj.SetValue "ConfirmOverwrite", "no"
obj.SetValue "ShowSaveAS", "never"
obj.SetValue "ShowSettings", "never"
obj.SetValue "ShowPDF", "no"
obj.SetValue "RememberLastFileName", "no"
obj.SetValue "RememberLastFolderName", "no"
obj.SetValue "ShowProgressFinished", "no"
obj.SetValue "ShowProgress", "no"
obj.WriteSettings True

END FUNCTION

Regards

Mingming

View solution in original post

10 Replies
Not applicable
Author

Hi !

You can try this. It works for me:

First, you have to set PDF-XChange print defaults for not to ask for a filename:

In "File" and "Pathname" you can write whatever you want.

This setting will make PDF-XChange print without prompting anything to the user.

Now the macro:









function PrintReport(sReport, sDestination)

ActiveDocument.PrintReport sReport, "PDF-XChange 3.0"

Set oSH = CreateObject("WScript.Shell")

oSH.RegWrite "HKEY_CURRENT_USER\Software\Tracker Software\PDF-XChange 3.0\Drivers\Control\Result.FileName", "", "REG_SZ"
oSH.RegWrite "HKEY_CURRENT_USER\Software\Tracker Software\PDF-XChange 3.0\Drivers\Control\State", "", "REG_SZ"

sFile = ""
sState = ""

while (sFile = "" or sState <> "Saved")

ActiveDocument.GetApplication.Sleep 100
sFile = oSH.RegRead ("HKEY_CURRENT_USER\Software\Tracker Software\PDF-XChange 3.0\Drivers\Control\Result.FileName")
sState = oSH.RegRead ("HKEY_CURRENT_USER\Software\Tracker Software\PDF-XChange 3.0\Drivers\Control\State")
wend

set oSH = nothing

set oFS = CreateObject("Scripting.FileSystemObject")
oFS.MoveFile sFile, sDestination
set oSH = nothing

end function



Just calling this function using the report name and the desired destination file name as parameters you will get the PDF right away.

Hope it helps !

Cheers



Not applicable
Author

Hi, Eduardo

Thanks for the suggestion.

Will try it out later.

Not applicable
Author

I'm having a problem with implementing Eduardo's solution. Im using v9 SR5 and this doesn't seem to work for me. When I press the button nothing happens. I have PDF-XChange 3.0 that was installed alongside with qlikview

Not applicable
Author

Hi,

I just found out that bullzippdf is quite good and providing great compatibility to the latest qlikview applications.

Here is the code used for pdf generation. You may find the bullzippdf online + ghost script, i will not provide url here.

Sub printPDF

vReport = "RP01" 'Set report

vName = "myReport" 'Name of output pdf

ActiveDocument.PrintReport(vReport), "Bullzip PDF Printer", false 'Printreport

reportFile = ReportFolder & vName &".pdf" 'Setting outputname

MyPrintPDFWithBullZip(reportFile) 'Call pdf printer

End sub



FUNCTION MyPrintPDFWithBullZip (pdfOutputFile)

set obj = CreateObject("Bullzip.PDFPrinterSettings")
obj.SetValue "Output" , pdfOutputFile
obj.SetValue "ConfirmOverwrite", "no"
obj.SetValue "ShowSaveAS", "never"
obj.SetValue "ShowSettings", "never"
obj.SetValue "ShowPDF", "no"
obj.SetValue "RememberLastFileName", "no"
obj.SetValue "RememberLastFolderName", "no"
obj.SetValue "ShowProgressFinished", "no"
obj.SetValue "ShowProgress", "no"
obj.WriteSettings True

END FUNCTION

Regards

Mingming

Not applicable
Author

Hi,

try to put the call to the printer after the while.

In this way it works fine in my case.

Not applicable
Author


mremisze wrote:
I'm having a problem with implementing Eduardo's solution. Im using v9 SR5 and this doesn't seem to work for me. When I press the button nothing happens. I have PDF-XChange 3.0 that was installed alongside with qlikview<div></div>


Hi,

try to put the call to the printer after the while.

In this way it works fine in my case.



Not applicable
Author


ste.san wrote:
Hi,
try to put the call to the printer after the while.
In this way it works fine in my case.
<div></div>


Sorry for multiple post... Mistake, try yo put the call BEFORE the while

mountaindude
Partner Ambassador
Partner Ambassador

I have Eduardo's code in the OnPostReload trigger in a document. It works great when the reload is done from within the qv.exe client, with the full GUI etc.

But when doing a "qv.exe /r abc.qvw" the call to ActiveDocument.PrintReport fails. Anyone else seen this? Any possible solution? I have a fully paid for version of PDF XChange, so that shouldn't be an inssue.

Could it be that PDX XChange needs a UI environment to work properly? Just speculating here..

/G

Please mark the post as a solution if it provided you with a solution to the topic at hand. Thanks!
Not applicable
Author

Hi G,

Try to use /l instead of /r in your batch file as a qlikview document needs to exist in order to use the activedocument call in your macro. /r only instantiates the scripting dialog and not an instance of Qlikview.

Kind Regards,

Footsie