Command-line switches

This topic gives a detailed description of command-line switches and examples of their usage.

Command-line usage

To view command-line switches for /datareport, run the following command:

dbforgesql.com /datareport /?

Note

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

Available command-line switches

All switches available for this option are listed below, along with usage examples.

Name Description
/connection Specifies a connection string with additional parameters.
Example:
dbforgesql.com /datareport /connection:"User Id=your_username;Server=your_server_name"
Usage: /connection:<connection_string>
/errormode Specifies the application’s behavior when an error occurs:
  • ignore – Ignores the error.
  • abort – Cancels execution.

Usage: /errormode:<ignore|abort>
/exitcodes Displays the list of exit codes that can be returned by the command-line process.
Usage: /exitcodes
/fieldseparator Specifies the field separator for a CSV report format.
Usage: /fieldseparator:<separator>
/format Specifies the report format.
Note: If multiple files or folders are generated for an HTML report, it will not be sent by FTP or email.
Available options:
  • PDF – A PDF file.
  • HTML – An HTML file.
  • MHT – An MHT (MIME HTML) file.
  • RTF – An RTF (Rich Text Format) file.
  • TEXT – A plain text file.
  • CSV – A CSV (Comma-Separated Values) file.
  • EXCEL – A Microsoft Excel 97-2003 workbook (.xls).
  • EXCEL2007 – A Microsoft Excel workbook (.xlsx) in Office Open XML format.
  • BMP – A BMP (Bitmap) file.
  • GIF – A GIF file.
  • JPEG – A JPEG file.
  • PNG – A PNG file.
  • TIFF – A TIFF (Tagged Image File Format) file.
  • WMF – A WMF (Windows Metafile) file.
  • EMF – An EMF (Enhanced Metafile) file.

Example:
dbforgesql.com /datareport /format:PDF
Usage: /format:<format_type>
/parameters Specifies values for parameters declared in a query in the report template.
Example:
dbforgesql.com /datareport /parameters param1:value1 param2:value2
Usage: /parameters <param_name1>:<param_value1> <param_name2>:<param_value2>[...]
/password Specifies a server password and overrides the one in the connection string.
Example:
dbforgesql.com /datareport /password:"yourpassword"
Usage: /password:<password>
/reportfile Specifies the report template file.
Example:
dbforgesql.com /datareport /reportfile:"D:\Reports\sample_report.rdb"
Usage: /reportfile:<file_path>
/result Specifies how to handle the generated report: save to a folder, send by email, or upload via FTP. Optionally, the report can also be sent by email.
Note: You can specify SMTP settings on the corresponding Options dialog page. To open the Options dialog, navigate to the Tools menu and select Options > Environment > SMTP.
Examples:
1. Save to folder:
/result folder:"D:\output\"
2. Send by email:
/result email:"[email protected]"
3. Upload via FTP:
/result folder:"ftp://hostname.net/output/" ftplogin:username ftppassword:your_password
4. Send by email and upload via FTP:
/result email:"[email protected]" folder:"ftp://hostname.net/output/" ftplogin:your_username ftppassword:your_password
Usage: /result folder:<folder_path> [email:<email_address>] | folder:<ftp_url_to_folder> ftplogin:<username> ftppassword:<password> [email:<email_address>]
/resultfilename Specifies the generated report file name.
Example:
dbforgesql.com /datareport /resultfilename:report1
Usage: /resultfilename:<filename>
/treatwarningaserror Specifies how to treat warnings:
  • Yes – Warnings are treated as errors; further behavior is determined by the /errormode argument.
  • No – Warnings aren’t treated as errors; execution continues with warning messages.

Usage: /treatWarningAsError:[Yes|No]

For more examples, see Automate report creation from the command line.