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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Macro not sending PDF email

Hello Friends

We have a Dashboard wherein I have a VB Script macro which exports a report to PDF and emails to the users.

It works find when run manually.

When we trigger the application reload with the help of a Batch file (.bat file) it reloads the application successfully and also generates the PDF report in desired folder. However it does not sends the Email. (Have used OnPostReload --> Run Macro)

Batch File  -----> Reload the Application --> OnPostReload -- > RunMacro ---> Send PDF report email.

The above scenario runs well when we manually reload the dashboard. The email is sent successfully once macro is triggered after reload.

However the email is not sent when we reload the dashboard with batch file. Only the PDF is generated in given path.

Is there something we are missing to get the emails sent while relaoding the dashboard with batch file?

Kindly help to resolve above issue. Let me know if you need any further details.

Thanks & Regards

Chintan Gala

20 Replies
Anonymous
Not applicable
Author

It may be running as default user, not aware how to set the context for the task scheduler.

Kindly help how can we set the same.

marcus_sommer

I mean these settings within the task-planner:

- Marcus

Anonymous
Not applicable
Author

Hello Marcus

The Windows Task scheduler is running with admin privileges.

Kindly find atatched screenshot -- task_scheduler.

Thanks & Regards

Chintan Gala

marcus_sommer

Unfortunately for me it never worked without a user-login and therefore I use the first option like in my screenshot. Pure logically it should also work with the other options but I think there are some essential settings or configurations missing and I'm not admin enough to find the real cause (and my workaround with the login works well since years). Maybe pcammaert could shed some light.

- Marcus

Anonymous
Not applicable
Author

Thanks Marcus. I will also try with the same settings as in your screenshot .

Meanwhile could you route this thread to others who may provide necessary settings required to resolve this.

Thank you again for your time and insights provided.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

I'm not really sure how I can be of help. I should note that I switched to using/promoting/supporting NPrinting a while ago, mostly for reasons of reliability and easy of deployment.

Chintan, is the macro reponsible for generating the PDF and sending the email?

marcus_sommer

I agree that using NPrinting will be in many cases a more reliable and cost-effective solution as to fiddle with all the macro-stuff and how to execute it properly.

I hoped you could give a hint why (at least in my case) it only worked when I'm logged in - all other options failed and I think the reasons are some missing configurations / rights but I have no idea which one it could be.

- Marcus

Anonymous
Not applicable
Author

Dear Peter

Yes, the macro is responsible for PDF generation and emailing the same.

The PDF gets generated but email is not being sent.

If we reload the application manually it also sends the email successfully.

But if we schedule batch file to reload the application, it only generates the PDF in folder but does not send email.

Thanks & Regards

Chintan Gala

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Then you will be able to capture failure information in your macro. If your system isn't able to forward your email for any reason whatsoever, it should indicate this by returning an error code or some kind of failure response. That will be helpful for figuring out where exactly we need to look for missing configuration information, or insufficient privileges or whatever.

Without this kind of information, it will be like shooting in the dark.

Anonymous
Not applicable
Author

Hello Peter

Okay you mean we need to capture the logs by putting some script in the macro?

currently we are not using anything in the script to capture the logs.

Thanks & Regards

Chintan Gala