Skip to main content
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

Hi Omid Ebrahim,

Thanks. I ran your qvw on my machine.

Print PDF: I still get SaveAs dialog. I am sending printer settings at my end. May be we can compare to know any settings make problem.

EMail:

1. I only changed the following value from 465 to 25 (my hosting company advice)

.item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 '465

2. As per the code below, either I should get message SendMail Failed" or "it was successful".

But I do not receive any of these messages. Unfortunately I use QV11 which no debugger for macros.

On Error Resume Next

          oEmail.Send

            If Err Then

               WScript.Echo "SendMail Failed:" & Err.Description

                               else

          msgbox("it was successfull")

          End If

Thanks again Omid for your support. Help as much as you can.

Regards,

KSP

omid5ive
Creator II
Creator II

are you set it your default printer?

and for email
are you shure you set your  mail and password correctly?

Not applicable
Author

Hi Omid Ebrahimi,

I have chosen Bullzip PDF finally. There are more elaborate codes, I found for this printer. SaveAs dialog has disappered

As far as mail is concerned, I used a different set of code that specifies NTLM parameter also. I first tested it in Excel VBA and then implemented it in macro. it is working fine too

Thanks for continued patient support. We will be in touch. I am going to add you as friend in this forum

Regards,

KSP

Not applicable
Author

Hello kspalani & Omid,

A great discussion indeed.

Can you kindly share the final qv document that is working without displaying any SaveAs dialog box? I am facing the same problem as well. I also have to use "primo pdf" and mail the created pdf file!

Regards,

Rajesh

Not applicable
Author

Hi Rajesh,

For PDF

See http://community.qlik.com/message/211426#211426

This works good in my win 7 64 bit OS for Bullzip Printer, which is also free.

For mail

See code samples attached in text files.

http://community.qlik.com/message/13115#13115

   

Regards,

KSP

soniacoprosa
Creator
Creator

Por fin me funciona. Muchas gracias.

ysiroong
Contributor III
Contributor III

I have a question about this as I'm using PDF-XChange as well.  How do you pass a variable in as the file name?  I had a qvw document set up using the old QlikViewPDF printer.  When we moved to Windows Server 2008, that printer no longer worked so I had to install PDF-XChange.  The pdf macro we built still works, but the file that is generated only has a generic name (and so it overwrites each copy that is created).

I'd like to be able to pass in a name to save the pdf files as they are being created.

Not applicable
Author

Hi

i am new in qlikview so any one can send the link for  study Macro. pdf for how use Macro and so ..about 

Not applicable
Author

Hi

This little bit of functionality is really helpful.

I have included it and it works like a dream.

However ....... Is it possible to loop the vba script so for in the example attached you would create 4 seperate pdf files one for each user ????

If you could this would be genius as I have tried and due to my limited VBA skills have spent more time scratching my head than producing pdfs

One other question I would have is how do you reset the orginal reg settings ? As once you have exicuted the script qv pdf automatically saves everything back to the pdf you set it to in the code and no longer asks you for a directory when saving

Not applicable
Author

Hi

Palani K S,

I have requirement to open the pdf documet after clicking on the button, which printer i have to do....?

Is there need to install something..?