I. Overview
By task schedule section, users can load the results into the database regularly, with data loading, collecting as well as submitting achieved periodically via report template.
For example, to generate monthly statistics of each company's sales performance, whose data are stored in databases of the branch companies, users can load the general performance of each division of the company into the head office databases via a combination of Data Entry and Task Schedule.
You will learn |
---|
|
II. Instructions
The first step is to make a daily report summarizing the status of inventories, and then schedule to run this report by Task Schedule, allowing aggregated statistics within the day to be generated and saved to another database for analysis purposes.
1. Make a Report
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 using Formula in Widget Value. Enter 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. Settings of Data Entry Attribute
Please refer to Data Entry Attributes for more information
Go to Template -> Data Entry Attribute via the toolbar and create a new Built-in SQL, then bind the Date and Subtotal of the report to the new table "inventory_sum".
3. 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. The Default User Group can be left blank.
2) Dispatcher object
Select the template, and set the Type to Data Entry.
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
Choose Detailed Frequency Setting for Frequency and click Add. Set the Run Time to "16 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
Data submitted today now appear in the table "Inventory_sum".