Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
crystles
Partner - Creator III
Partner - Creator III

Nprinting sending email with no data in report

I have a report that is sent out weekly. It is being sent to our IT help desk directly and generates a help desk ticket. But when there is no data in the report, we don't want it to send out the email.

Is there a way to make the scheduler not email the report if there is no data?

4 Replies
Anonymous
Not applicable

I generate reports in PDF using VBScript.

Inside the report, it has a table and only when there is some value to show, the report is generated.

So, the idea is:

---- begin some code in VBScript

set doc = qv.OpenDoc("myQvwFile")

condition = doc.Evaluate("sum(myQvwField)")

IF condition > 0 then

     doc.PrintDocReport("nameReport", "PDF Printer")

ENDIF

---- end some code in VBScript

The argument to Evaluate function is a Qlikview expression.

crystles
Partner - Creator III
Partner - Creator III
Author

That sounds like exactly what I need. AND I do know VB so that's perfect.

Where are you putting the script though? In the PDF document?

Anonymous
Not applicable

There are two ways:

  • You can create an .vbs file. See the tutorial here: QlikView automation by external VBScript scripts
  • You can put your code in the macro area: Tools - Edit Module. (of course, in this case, you cannot use the qv.OpenDoc, your document is already opened =P ).
Daniel_Jenkins
Specialist III
Specialist III

Hi Crystle,

You can implement a pure NPrinting solution using Conditions.

Please take a look at this article for more information.

- Daniel.