Skip to main content
InSource Solutions

TN - 1030 Ensure Dream Reports Automatically Generate

Description

You can configure Dream Reports to automatically run in the project properties by setting the Start Mode to Run as a service and defining the project to start. In some instances, however, you may notice Dream Reports does not always run. This article explains how to create a Watchdog mechanism, which controls the project status and reloads it in case of any failure.

  • Author: Mario Meza
  • Published: 9/18/2017
  • Applies to: Dream Reports 4.83 and above

 

The idea is to run a batch file, which checks the current project status and depending on the result, performs the corresponding action.

A project can have 4 possible states:

1.    No project is running
2.    Generator.exe is not running
3.    LoggerRt.exe is not running
4.    The project is running OK.


When the batch file is started, it returns one of 4 numbers, and in case of 1, 2, or 3, it starts the defined project.
 

The batch file can be accessed from the following link

 

Once you’ve placed the .bat file you will want to update it with the path to the desired project.  To do this open the file with an editor, such as notepad++.

 

clipboard_e19660bfa5e2c2e5f96963310f0058910.png


You should see something similar to the image (below).

clipboard_e524d81012748c5ae262177913312f5db.png

 We need to update the path(s) in yellow (above) to reflect the current path of the desired project. You can get this information by navigating to the project and SHIFT+RB on the desired application and selecting the option ‘Copy as Path’. Replace the items in yellow with the path to your project and save.

clipboard_e84e30046355cf058a0faa153a56e27d4.png

 

Once the path has been updated, the simplest way to get this working is to place the .bat file in the startup folder. You can right click on the .bat file, create a shortcut and paste the shortcut in the start-up folder.

 

clipboard_e20481e4848cf2620b68a70c0e18b9fd9.png


 

To access the start-up folder, from Run enter shell:startup

 

clipboard_eba9cd6f3094ffd3a3d2958140f2e3ce5.png

 

This will take you right to the start-up directory in your system. Paste the Shortcut.

 

clipboard_e6609b3d04f8d3542bf42c4f37b712684.png

 

 

You can validate this works by clearing the Auto-Start configurations to their defaults for the project and reboot the machine.

 

clipboard_eba9a884ddb0cdfb141460ff68d2c001f.png

 

You should see that the project will automatically enter a running state. Note: you may see the command prompt remain open until the system is done loading and the RTM enters a running state. The window should then automatically close. (This may take a couple minutes)

clipboard_eadc4fb7fac1c1122a1b6406d18d14045.png

 

You also have the option to set up a Scheduled Task. This may actually be the most reliable option since it has some additional logic for error handling. You can also enable the logger for the task, so should it ever encounter an issue, you have a place to start an investigation. This was option was tested on Server 2016 by creating a Scheduled Task with the following settings.

 

General:

Run whether user is logged on or not

Run with the highest privileges

Configured for Windows Server 2016

 

Trigger

Task begins At startup

Delay task for : 1 minute

Stop task if it runs linger that : 30 minutes

Enabled

 

Action

Action : Start a program

Program/Script (Path to where the .bat file resides this is the FULL Path. Copy as Path and remove the “”)

Start in (The directory where the .bat file resides)

 

Settings

Allow task to be run on demand

Run task as soon as possible after a scheduled start is missed

If the task fails restart every : 1 minute

Attempt to restart up to : 3 times

Stop the task if the task runs longer than 1 hour

If the running task is not end when requested, force it to stop

 

It is recommended to maintain the Auto Start configurations in the DR project outlined at the start of this article. This .bat file is just a fail safe for those instances when the application fails to load due to some unknown reason.

Here are some interesting things about...

  • Was this article helpful?