When we want to run a report automatically, we follow these steps.
Config email and cron parameter by sql2report
In the section Cron when you are editing a report, you have to fill data Filter’s Value if the report has filters, Email and File and active the tick “Active”.
In the example we have set the “CUSTOMER_GUEST” report to run every day at 10 am, will generate an Excel report that will be sent to the e-mail info@domain.com. We have also indicated that the generated file is not deleted from the server.
When we have completed all the data, the report and we will keep this message:
Enable Autorun in magento by AOE Scheduler
Thanks to AOE Scheduler plugin, we can see the execution and planning begins.
You have to go to System->Scheduler->Schedule Configuration
In the list, we see our report, in the example called “sqlreport_CUSTOMER_GUEST”.
Select the task, select “Run now” on Actions and click Submit, the report will run and send a mail to the address you have configured, and check that the execution is correct.
Now we schedule executions for it in the same window, we select our report, in the example “sqlreport_CUSTOMER_GUEST” in actions select “Schedule Now” and click on Submit, we see the following message.
The autorun will be scheduled, you can see it going to System->Scheduler->List View
From the table, we select our task in the Code field and see two executions, one SUCCESS that is what we have executed to test PENDING works and other programming that is next run.