KB-27705: Generating a report every X minutes.

Question:

How can I create a report that repeats itself periodically in a regular time interval (for example, every 15 minutes)?

Solution:

To do so, you can create a Chrono Tag that fires a script that generates the report whenever the specified time is reached. This script can be created at the tag’s OnPreset event.

Example:

Script OnPreset
ExcelReport.PrintToFile(Str(hour) + “-” + Str(minute) + “-” + Str(second) + “.xls”, 1, Chr(9), 1)



In the example above, a report in Excel format (.xls) will be generated every 15 minutes, and the name of each report generated is the time (hh-mm-ss) when it was fired. Remember that the data is already being recorded by a historic.

NOTE: The example above illustrates just how to format reports according to time. In a complex application using this resource, you will need to apply day/month/year to each report’s names: if a report is genetated at the same time of a pre-existing one, there will be a formulation conflict, and old data will be replaced. 

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

,

Deixe seu Comentário

Seu endereço de e-mail não será publicado. Campos marcados com asterisco são obrigatórios *