RepGetControl
- Last UpdatedJul 18, 2023
- 2 minute read
Gets report control information on a report. This function is a blocking function. It will block the calling Cicode task until the operation is complete.
Syntax
RepGetControl(ReportName, Type [, sClusterName])
ReportName:
The name of the report (can be prefixed by the name of the cluster that is ClusterName.ReportName).
nType:
The type of report control information to get (send back in the return value):
0 - State of the report - returns one of:
• 0 -Idle
• 1 - Waiting for PLC data for trigger
• 2 - Waiting for PLC data
• 3 - Running
1 - Time of day that the report is due to run next.
2 - The report period, in seconds, or week day, month or year, for example, if the report is weekly, this is the day of the week, 0 (Sunday) to 6 (Saturday).
3 - Synchronisation time of day of the report, for example, 10:00:00 (In seconds from midnight).
4 - Type of report schedule - returns one of:
• 0 - Event triggered
• 1 - Daily
• 2 - Weekly
• 3 - Monthly
• 4 - Yearly
5 - Report state - returns one of:
• 0 - Enabled
• 1 - Disabled
sClusterName:
Name of the cluster in which the report resides. This is optional if you have one cluster or are resolving the report server via the current cluster context. The argument is enclosed in quotation marks "".
Return Value
The control information, as an integer.
Related Functions
Example
Next=RepGetControl("SHIFT",1,"ClusterXYZ");
! Sets Next to the time that the report is due to run.
! Display a message at the prompt AN (AN2) if
! the report is running.
IF RepGetControl("SHIFT",0,"ClusterXYZ")=3 THEN
Prompt("Shift report is running");
END