I. Overview
Report data can be exported daily. For example, users are able to export data generated from 0:00 to 23:59 for the day and save it as a file, or share it daily with others.
You will learn |
---|
|
II. Example
1. Template Example
Take the database table "Inventory" as an example. We'll set up a task schedule on this table, and send daily reports of inventory changes to the Development department.
1) Prepare a dataset
Create a DB query "ds1" and set parameters for start and end time to filter today's data.
SELECT [Date], Warehouse_entry, Discharge_from_warehouse FROM Inventory
WHERE [date]>='${p_start_time}'
AND [date]<='${p_end_time}'
ORDER BY [date]
2) Add parameters
Add parameters for start time ($p_start_time) and end time ($p_end_time) to the Parameter Pane. Set as text widgets.
Click on the widgets and specify the start and end time of the day by Formula in Widget Value. Type in the following fomula for starttime Format(today(),"yyyy-MM-dd 00:00:00"), and Format(today(),"yyyy-MM-dd 23:59:59") for endtime.
3) Edit a report
Drag and drop the data needed to the cell and set its style, then save the report.
2. Schedule a Task
Go to Manage -> Task Schedule -> Add a Task on the platform. Please refer to Task Schedule Setting Steps for detailed instructions
1) Basic setting
Enter a task name. Choose Development for Default User Group -> Dept.
2) Dispatcher object
Select the template.
The default values of parameters are same as those in the report designer, with Type set to Formula. You can copy&paste the formulas here for convenience.
p_start_time = Format(today(),"yyyy-MM-dd 00:00:00")
p_end_time = Format(today(),"yyyy-MM-dd 23:59:59")
Set the file name to ${today()} Inventory Flow Report
3) Schedule cycle
Select Detailed Frequency Setting for Frequency and click Add. Set the Run Time to "15 Hour 0 Minute" and Execution Date to "Daily", and check "Select All" for Month. It is also suggested to configure the task restart frequency.
4) File process
Click on Next and choose Mounting Platform, then set up the Mount Directory as well as its name.
Note: please assign View permission of the directory to the corresponding user group first.
Other processing options, such as Platform Notification, can be checked as well. Click Save.
5) Check the run status
III. View Results
Login the platform by account of Mike (Mike from Development), and a "Daily Inventory" section appears under the determined directory, once the task completed its first execution.
Notifications will be sent via the platform.
Also, files generated from Task Schedule can be found in the folder "WEB-INF/schedule".