Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro to create PDF

Hi,

I have gone through the interesting discussion " Macro to export AND mail report as PDF"  by different authors in the discussion started by in October 2010 by JochenAndries  (using Bullzip PDF). Em Vau suggested in Februaru 2012 to use QlikViewPDF. Thanks to both and others contributed on the same discussion. Excellent automation tips!

I have used QlikVewPDF.  I have combined sub code and function code for simplicity. The code works fine but  QlikViewPDF printer dialogue opens, which should not. The PDF file should be saved automatically.

I am attaching  image of code, image of  saveas dialog and the QVW document.

                                                  

Kindly suggest how we can avoid the SaveAs dialog.

Regards,

KSP

Code
Image1.png
Image2.png


21 Replies
Not applicable
Author

I use PDF-XChange and the method should work in your case as well. Open 'Devices and Printers' in the windows Start menu. Look for QlikViewPdf in Printers and Faxes section. Right-click on the icon and select 'Printing Preferences'. Scan through the sections and you should find a place to change the 'Save' preferences. For example, in PDF-XChange, it is in 'Save' section.

omid5ive
Creator II
Creator II

hi kspalani

you can use this code for printing pdf with qlikview PDF

sub printRP01

printReportPDF "C:\Temp\18T.pdf"

ActiveDocument.GetApplication.Sleep 2000

ActiveDocument.PrintReport "RP02", "QlikViewPDF"

ActiveDocument.GetApplication.Sleep 10000

end sub

'===========================================================================

Function printReportPDF(pdfOutputFile)

Set WSHShell = CreateObject("WScript.Shell")

     WSHShell.RegWrite "HKCU\Software\QlikViewPDF\OutputFile", pdfOutputFile, "REG_SZ"

     WSHShell.RegWrite "HKCU\Software\QlikViewPDF\BypassSaveAs", "1", "REG_SZ"

Set WSHShell = nothing

End function

Not applicable
Author

Hi Omid Ebrahimi

Still I get SaveAs dialog. I wish to avoid it and save directly without user intervention,

If you can guide, it would be great.

Regards,

KSP

Not applicable
Author

Hi Palani,

Please find the attached file for PDF Export n Mail, hope it will help you to solve the issue.

omid5ive
Creator II
Creator II

i attached it

you should set your mail and password on macro

Not applicable
Author

Thanks Omid Ebrahimi and qvarunprasadh

Thanks for your quik help. I tried creating PDF from the scratch through Bullzip. No Luck.

I am running on Windows 7 Professional 64bit. Perhaps Windows 7 64 bit is not allowing direct saving of PDF, without a SaveAs dialog capturing location and filename.

The code you have shared seemed to be working perfect. May I know which OS you are operating on?

Regards,

KSP

omid5ive
Creator II
Creator II

i use os same you

windows 7 64 bit

Not applicable
Author

Hi Omid Ebrahimi,

Thanks for sharing the doc. Appreciate. I copy pasted the script andd created same variables. Following are observed:

1. PDF printing still opens the SaveAs dialogue

2. In mail, I changed the port number to 25 (as advised by my hosting company). Mail script neither shows success nor error. This is weird.

If you can assist, it would be great. I am attaching my doc.

Regards,

KSP

omid5ive
Creator II
Creator II

hi kspalani

i check it

it work correctly with no saveas dialog

are you create qv folder in drive c?

and for second question

icant undrstand your problem can you explain it?