Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

dynamically save various reports as pdf with different filename


Dear All,

I am trying to automatically save various reports as pdf.  Reports should have different file name.  May i kindly ask how to do it in qlikview.

I appreciate your help.

Regards,

1 Solution

Accepted Solutions
Frank_Hartmann
Master II
Master II

i have attached the macro! First it selects 2014 and then loops through BusGrp, then selects 2015 and loops again through BusGrp,

then selects 2016 and loops again through BusGrp :

Aufnahme_2016_11_01_18_58_43_589.gif

Tested with your former attached qvw.

works fine for me!

View solution in original post

79 Replies
marcus_sommer

You could use a specialized tool like QlikView NPrinting  or something like this: Print Report to PDF with open source PDFCreator.

- Marcus

Frank_Hartmann
Master II
Master II

You could also use a vbs-macro in order to export your charts/tables into one or more predefined PP-Templates.

Inside the vbs-code you could also make the filename of the PP-Template dynamically e.g. adding a timestamp or other logic to the filename and determine where to save the reports. If this is something that fits your needs then let me know for further assistance.

Not applicable
Author

Thanks Marcus / Franc for your reply.

Below is the sample of the code:

ActiveDocument.Fields("Company").select "Name of Company"

ActiveDocument.Fields("Year").Select "XXXX"   // where XXXX is the year

ActiveDocument.PrintReport "RP01", "PDFCreator"

I have 20 or more listed company and i need to print each company's financial for several years, let say from 1990's to present.  where report  for each year and each company is required.

What i need is the syntax to auto save the report and save it with different filename automatically.

Regards,

marcus_sommer

You need to loop through your field. Here is an example for exporting objects to excel - but the logic is the same like your printing-task.

- Marcus

Not applicable
Author

Hi Marcus,

Thanks.  Please send an example. looping is fine but what i cannot understand is how to save it with different filename (automatically)

Regards

Not applicable
Author

Dear Frank,

Thanks...Please share sample codes as it fits my requirements..

Frank_Hartmann
Master II
Master II

Hi Roberto,

I have attached an example for exporting/creating multiple PP-reports dynamically!

You will just have to adapt the paths inside the vba code in order to get it work in your environment!

This macro loops through every sheet of you qlikview document and exports the relevant charts -->

(for setting up the PPTemplate you will have to copy the relevant chart (e.g. CH01) once into the PP Template and name the object like this: Document\CH01). The macro also loops through the fields "company" and "year" and it creates  a new Report everytime when the one loop is finished.

hope this gives you an idea on how to get started!

Frank

Frank_Hartmann
Master II
Master II

are you on personal edition?

Not applicable
Author

Thanks Frank.  I will check the zip file and get back to you.

Yes, i am currently using the personal edition.