Automating Reports

I have several reports created on windows using the Report Designer and all works good.

Is there a good way to automate these reports and email a pdf of them out at a specific time such as 12:05 email out the daily report.

Thanks in advance.

There is as long as you keep a client open. Since the report is part of the client you have to have a client open. Typically, people will open a dedicated client on the server machine that just has one report and at a specific time it is emailed or printed or saved.

So let’s say you have a report on a window. The report can be visible or not. Here are the steps to email it at a specific time:

  1. Add a dynamic property on the Root Container (right click on root container and select customizers > dynamic properties) called emailReport that is a boolean.

  2. Bind the emailReport property to the following expression:dateFormat(now(5000), "HH:mm") = "12:05"

  3. Add the following propertyChange script to the Root Container (right click on root container and select event handlers > property change):if event.propertyName == "emailReport": if event.newValue == 1: report = event.source.getComponent('Report Viewer') bytesPDF = report.getBytesPDF()"", "", "Subject", "Body", 0, [""], ["report.pdf"], [bytesPDF], 60000*5, "Username", "Password")You just have to make sure the report bindings are polling so they will be updated when the script runs. This is just a starting point. Let us know if you have questions.