The /datareport command lets you create data reports from the command line. This is particularly useful when you need to generate reports repeatedly using the same report template.
To generate a report from the command line, first create a report template using Data Report Wizard. To specify parameter values from the command line, include the corresponding parameter names in a query in your report template.
Note
Parameter values specified directly in the command line override values defined in the report template.
dbforgesql.com /datareport [/option_name1[:value | [parameter1:value parameter2:value ..]] /option_name2 ..]
To view the list of switches available for /datareport, run the following command:
dbforgesql.com /datareport /?
The output displays all switches and their descriptions.
To run dbForge Studio CLI commands, open Command Prompt and navigate to the folder that contains dbforgesql.com. The default path to this executable depends on where dbForge Studio for SQL Server is installed. If you installed dbForge Studio:
As a standalone tool
C:\Program Files\Devart\dbForge Studio for SQL Server
As part of the dbForge Edge bundle
C:\Program Files\Devart\dbForge Edge\dbForge Studio for SQL Server
The /reportfile and /result switches are required to generate a report. All other switches are optional.
To specify the path to the .rdb file containing your report template, use the /reportfile switch.
dbforgesql.com /datareport /reportfile:<file_path> /result folder:<folder_path>
dbforgesql.com /datareport /reportfile:<file_path> /result folder:<folder_path>
dbforgesql.com /datareport /reportfile:<file_path> /result email:<email>
dbforgesql.com /datareport /reportfile:<file_path> /format:<file_format> /result folder:<ftp_folder_url> ftplogin:<username> ftppassword:<your_password>
/format switch.dbforgesql.com /datareport /reportfile:<file_path> /result folder:<folder_path> /format:<file_format>
/parameters switch.dbforgesql.com /datareport /reportfile:<file_path> /format:HTML /parameters <param_name1>:<param_value1> <param_name2>:<param_value2> /result folder:<folder_path>
1. Open the Data Report Wizard in one of these ways:
2. In the Data Report Wizard, configure the report settings.
3. If you want to specify values for report parameters from the command line, select Custom Query on the Choose a data connection page and include one or more parameters in the query.

In this example, @territory_name is the parameter name that must be specified from the command line. For more information, see Specify parameters for a report from the command line.
4. Save the report template as an .rdb file by selecting File > Save.
To send the generated report by email, configure the email account settings in the Options dialog.
1. On the menu bar, select Tools > Options.
2. In the Options dialog, navigate to Environment > SMTP.
3. Configure the following SMTP (Simple Mail Transfer Protocol) settings:
From address – Specify the email address that appears as the sender of the report email.
SMTP server – Specify the hostname or IP address of your SMTP mail server (for example, smtp.gmail.com).
Port – Specify the port number to connect to the SMTP server.
Timeout (seconds) – Specify the maximum time to wait for a response from the SMTP server.
Enable SSL – Select the checkbox to enable encrypted communication with the SMTP server.
Requires authentication – Select the checkbox if the SMTP server requires user authentication.
Name – Specify the username you use to authenticate with the SMTP server (the email address).
Password – Specify the password or application-specific password for SMTP authentication.

4. Click OK.
This command generates a report based on the salesorders-report.rdb template and saves the result in HTML format to the specified folder.
dbforgesql.com /datareport /reportfile:"D:\Reports\Templates\salesorders-report.rdb" /format:HTML /result folder:"D:\Reports\Generated reports\"
This command generates an HTML report filtered by the Northwest sales territory using the territory_name parameter.
dbforgesql.com /datareport /reportfile:"D:\Reports\Templates\salesorders-by-territory.rdb" /parameters territory_name:"Northwest" /format:HTML /result folder:"D:\Reports\Generated reports" /resultfilename:"salesorders-northwest"
For more information, see Specify parameters for a report from the command line.
You can generate a report and distribute it via multiple channels. This command saves the generated report to a folder on your computer and sends it by email simultaneously.
Note
To send reports by email, configure SMTP settings. For more information, see Configure email account settings.
dbforgesql.com /datareport /reportfile:"D:\Reports\Templates\salesorders-report.rdb" /format:PDF /result folder:"D:\Reports\Generated reports" email:"[email protected]"
This command generates a PDF report based on the salesorders-report.rdb template and sends it to the specified FTP server using the provided authentication credentials.
dbforgesql.com /datareport /reportfile:"D:\Reports\Templates\salesorders-report.rdb" /format:PDF /result folder:"ftp://ftp.example.com/reports/" ftplogin:"ftpuser" ftppassword:"P@ssw0rd123"