Running Reports in Batch Mode

Reports listed under the PR-Tracker Reports menu may be run in batch mode by calling RUNREPORT.EXE from a command line. When a report is run in batch mode the default output is an html file. The output may also be a text file, an Excel file or a rich text file. This feature can be used to schedule report generation on a periodic basis by scheduling RUNREPORT.EXE to execute using the Task Scheduler on Windows 2000 or above,  or the AT command on NT.

Required RUNREPORT.EXE command line arguments:

/s  --  this flag instructs RunReport to execute in silent mode. In silent mode the report results are output a file instead of to the screen.  Also no error dialogs are displayed if they occur; errors are recorded in PrtrackerErrors.log instead.

/i <initialization file> -- this flag is used to specify which .ini file to use as input. If you are using PR-Tracker the file should be prtracker.ini. If you are using PR-Tracker Web Client it should be prwebcli.ini. If you are not starting RUNREPORT.EXE from the same folder where the ini file is located, and you consequently supply a path name that includes spaces, the initialization file pathname must be enclosed in quotes.

report=<report file>  -- this argument specifies which report to run according to the name of the report file name which must be enclosed in quotes. RUNREPORT.EXE will look for this file in the folder specified by the database_home setting in the initialization file.
 
project=<project name>
--
this argument specified what project to run the report against. The project name should be enclose in quotes.

Optional RUNREPORT.EXE command line arguments:

htmlreportname=<output file>  --  the output file specifies what file the report output will be recorded in and what format the report will be in. The file name may be a path name or not. If the file name is not a pathname, the output file will be located in the folder that RUNREPORT.EXE started in. If the output file name includes spaces, it must be enclosed in quotes.

If this argument is not specified on the command line, the output file will have the same name as the report file name except that it will end with html.

The output file name extension determines the output format. The output file extension may be .html (hypertext markup language), .txt (text), .rtf (rich text format) or .xls (Excel format). 

Historical Note: Originally RUNREPORT.EXE only supported html output, hence the argument name "htmlreportname" is somewhat misleading.

query=<query name>  --  where query name is one of the quieres listed under the PR-Tracker query menu. The query name should be enclosed in quotes.

startdate=<dd-mmm-yyyy>  --  applies only to some reports

enddate=<dd-mmm-yyyy>  --  applies only to some reports

weeks=<number of weeks>  --  applies only to some reports

Example calls to RunReport.exe

RUNREPORT.EXE /s /i prtracker.ini report="Status Summary.rpt" project="Demonstration Project"

RUNREPORT.EXE /s /i prwebcli.ini report="Work remaining summary.rpt" project="Demonstration Project" query="Originated by Tom Tester" htmlreportname="C:\PR-Tracker Reports\WorkRemainingSummary.html"

RUNREPORT.EXE /s /i prtracker.ini report="Daily Transaction summary.rpt" project="Demonstration Project" startdate=01-Jun-2000 enddate=01-Dec-2000

Example AT command (for Windows NT)

AT 2:00AM /EVERY:M,T,W,Th,F,S,Su "C:\Program Files\PR-Tracker\RUNREPORTS.CMD"

where RUNREPORTS.CMD contains the following example text:

C:

cd \Program Files\PR-Tracker

RUNREPORT.EXE /s /i prtracker.ini report="Status Summary.rpt" project="Demonstration Project"
htmlreportname="C:\Web Site\StatusSummary.html"

RUNREPORT.EXE /s /i prwebcli.ini report="Work remaining summary.rpt" project="Demonstration Project" htmlreportname="C:\Web Site\WorkRemainingSummary.html"


Bug tracking doesn't have to be complicated | Help | Site Map