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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Automatic generation of reports

Hi everyone

My internal clients are so happy with QlikView that they are asking if it is possible for an application to print out a expense report every month and send it via email to management. They want to:

1. Generate an expense report for every month e.g. July and each department

2. Export it to pdf

3. Send it to a list of email addresses

I have tinkered a bit with the Report editor, looked at Help files and this forum and have a notion that I need to create a macro.

Dont have VB or Java script experience but am willing to look through the API Guide. Can anyone help me pinpoint what type of macro I should look for or create?

Or better yet, does Qlikview offer the method of generating and exporting a report on a time period basis?

any thoughts are welcome!

Thanks!

13 Replies
amars
Specialist
Specialist

Hi,

Attaching a file containing a macro , which will export & send mail report's in specified format (PDF, Excel) . I have created different Report's in Qlikview for PDF print, For excel I use a chart ID. I have an internal table with a structure like

Load * inline

[reportName, reportID, ExcelExportID

Sales, RP01, CH01

Purchase, RP02, CH02]

Similarly for excel export format I Have created a table like this

Load * inline

[ExportTo

Excel

PDF]

& I have provided input box for selection by user & this macro will work according to the selection.

Regard's

Amar

amars
Specialist
Specialist

You can create a batch job to reload the file. & on Reload can run this macro. so it will send mail automatically.

Not applicable
Author

Thanks amars. Would an OnReload macro be flexible enough to select one report from a list of reports and select a bookmark based on that report?

amars
Specialist
Specialist

By default it will take the first value from the reportName, & the ExportFormat. Actually I have written this macro to be triggered on the click of a button . You can programm the macro to send specific report's according to ur need.

Not applicable
Author

Not to sound stupid but this is the OnReload macro already found in QlikView right since you mentioned that you have written this macro ...

amars
Specialist
Specialist

Go in Document Properties -> Macros -> Document Event Triggers . Here you will find event's , select an event OnPostReload & in the dropdown before that u can select a macro from the available macros. So it will be triggered on that event.

Not applicable
Author

Hello amars

Thanks for the hints. Will have to read up in the Help section about using macros...

Not applicable
Author

Jeanne,

Can you please, send me the macro that you use to automatically export?

Thanks

Straface Luciano

Not applicable
Author

Any idea how to trouble-shoot an issue where the PDF is not generated from this type of function / macro, initiated by the PostReload? I'm running Qlikview 8.01 if that matters.


Function fPrintReport2PDF(oReport, pdfOutputFile)
Set WSHShell = CreateObject("WScript.Shell")
WSHShell.RegWrite "HKEY_CURRENT_USER\Software\QlikViewPDF\OutputFile", pdfOutputFile, "REG_SZ
WSHShell.RegWrite "HKEY_CURRENT_USER\Software\QlikViewPDF\BypassSaveAs", "1", "REG_SZ"
ActiveDocument.PrintReport oReport "QlikViewPDF", false
WSHShell.RegWrite "HKEY_CURRENT_USER\Software\QlikViewPDF\BypassSaveAs", "0", "REG_SZ"
Set WSHShell = nothing
End Function


I have the macro settings "System Access" and "Allow System Access" selected. I'm sending in a QV Report ID for oReport, and the full path where I want the PDF saved for pdfOutputFile ("D:\Qlikview\days_to_ship.pdf"). I know I have full access to this folder, since I can create and edit files in this folder from windows explorer.

Thanks in advance to anyone who can help out!