DFreport — Client-side, command-line interface for executing reports
DFreport
[-S server]
[-U username]
[-C password]
[-JS js]
[-CSS css]
[-usealias]
[-logo]
[-e errfile]
[-o outfile]
{-CMD cmd}
{study#}
DFreport runs DFdiscover reports outside of DFexplore, making them available to run from a command-line or scheduled via the UNIX cron facility.
Authentication. To authenticate, DFreport requires the username and password for connection to a specific database server. These may be supplied as:
command-line options, the user can specify
-S ,
servername-U and
username-C when the program is
run, or
password
environment variables, the user can set the variables
DFSERVER ,
servernameDFUSER and
usernameDFPASSWD before the
program is run.
password
Specification of command-line options takes priority if both command-line options and environment variables are supplied. Refer to User Credentials for more information.
Database Permissions. Subsequent to authentication with a specific database server, use of DFreport is allowed (or disallowed) by the DFexplore - Reports view or Server - Run reports permissions.
An authenticated user with one of these role permissions will then be able to run reports. The reported data is filtered by user permissions, which may further be limited by visit, plate and level restrictions associated with the user's role.
DFreport provides no warning that some records cannot be exported due to permission restrictions as this would itself provide information about the existence of restricted data records.
-CMD command | resource request sent to server, specifying report to execute |
-JS command | matching javascript resource for report interactivity |
-CSS command | matching stylesheet resource for report styling and presentation |
-usealias | output the subject alias, if defined, in place of the subject ID. If there is no subject alias, output the subject ID. |
-logo | include the study logo in the top-left corner of the HTML output. If not defined, or not available, the study name is used |
Output File.
By default, output from DFreport is written to standard output (the command-line output).
To write the output to a specific file, specify the filename with
-o .
The user must have filesystem permission to create or modify the file.
If outfileoutfile is specified as a relative pathname, the file is
created relative to the DFreport command invocation directory.[13]
Output from legacy reports is written as is (plain text) while output from standard DFdiscover reports is in HTML or JSON format, determined by the file extension of the argument file.
Error Output.
Re-direct any error messages to a specific file with the
-e option.
By default, error messages are written to standard error and hence would get
intermixed with data if the data is being exported to standard output.
errfile
DFreport exits with status 0 if the command was successful.
Exit status 1 indicates that an error occurred - errors are written to standard error
or the errfile file if -e was specified.
DFexplore includes a convenience feature, available from > , to display the command required to run a report. For example, run the Enrollment by Site report within DFexplore and select > to obtain this command (line breaks are for presentation only):
DFreport -S explore.dfdiscover.com -U demo_user1 -CMD "/DFedc?cmd=getreport&name=enrollment&title=Enrollment%20by%20Site&json&compress"
-JS "https://cdn.dfdiscover.com/v5.2/js/DF_Enrollment.min.js" -CSS "https://cdn.dfdiscover.com/v5.2/css/DF_ReportStyles.css"
252 -logo -o DF_Enrollment_20191028140508.html -C xxx
Substitute the username for demo_user1,
user password for xxx and provide an output
filename in place of
DF_Enrollment_20191028140508.html.