Reportizer Viewer Documentation
Index

Command Line Parameters

Here, switches and parameters of Reportizer Viewer command line are described. You can use them when launching Reportizer Viewer from .bat files, shortcuts, or in Reportizer Viewer calls from your own applications.

The switches and parameters, enclosed in square brackets [], are optional, and the switches, enclosed in arrow brackets <>, are required.

Notes

1. Switches and parameters of the command line override the corresponding report settings.

2. Options of the command line are applied only to report(s), specified in the command line.

3. It is recommended to use full file names wherever file names are used.

4. If your command line parameter value contains quote characters, replace each of them with &quot;.

Usage

rptview.exe [/PrinterSetup]  [/PrintFolder]  [/DisableOpening]  [/DisableExporting]  [/DisableEditing]  [/PrinterName=<printer name>]  [/PaperSize=<paper size>]  [/PaperSource=<paper source>]  [/DuplexMode=<duplex mode>]  [/print]  [/copies=<count of copies>]  [/pages=<print pages>]  [/collate[/StretchPrint]  [/minimize]  [/CloseWhenDone]  [/changedb=<database name>]  [/changedbserver=<server name or IP address>]  [/changedbport=<port>]  [/UserName=<database user name>]  [/Password=<database password>] 
[/ExportToFile
=<file name to export report to>]  [/ExportFormat=<target export format>]  [/ExportSeparatePages]  [/ExportGrayScale]  [/ExportPageStart=<number of starting page to export>]  [/ExportPageEnd=<number of ending page to export>]  [/ExportEncoding=<target export encoding>]  [/ExportTextSeparator=<target export field separator>]  [/ExportDocTitle=<target document title>]  [/ExportAuthor=<target document author>]  [/ExportLineSeparator=<target export line separator>]  [/ExportHorzCellDiff=<target export horizontal object interval>]  [/ExportVertCellDiff=<target export vertical object interval>]  [/ExportLayout=<document layout type>]  [/ExportTargetImageFormat=<target image format>]  [/SQLParamNames=ParamName1%#%ParamName2%#%...]  [/SQLParamValues=ParamValue1%#%ParamValue2%#%...]  [/SQLParamTypes=ParamType1%#%ParamType2%#%...]  [/SQLMacroNames=MacroName1%#%MacroName2%#%...]  [/SQLMacroValues=MacroValue1%#%MacroValue2%#%...]  [/VarNames=VariableName1%#%VariableName2%#%...]  [/VarValues=VariableValue1%#%VariableValue2%#%...]  [/StaticPassword=<password for static report>]  <report file|folder to show list of files from>

General Options

/PrinterSetup

Printer Setup dialog is shown before report previewing.

/PrintFolder

Specifies that Reportizer Viewer should print the list of files from the folder, specified in report file|folder to show list of files from parameter.

/DisableOpening

Disables Open button.

/DisableExporting

Disables Export button.

/DisableEditing

Disables Edit report template button.

/PrinterName=<printer name>

Specifies printer, which should print the report. This switch overrides printer settings, saved in the report (if any). This switch is used with /print or /preview switches. If omitted, the report printer will be used (if it is specified and the Select Printer property is set to Yes); otherwise current or default printer will be used.

/PaperSize=<paper size>

Specifies printer paper size (for example, A5, A4 etc.). If omitted, the report settings are used; if the corresponding report settings not specified, current printer settings are used.

/PaperSource=<paper source>

Specifies paper source for printer, which supports several paper sources. If omitted, report settings are used; if the corresponding report settings not specified, current printer settings are used.

/DuplexMode=<duplex mode>

Specifies duplex mode for printer, which supports duplex printing. Possible values are: SIMPLEX, HORZ or HORIZONTAL, VERT or VERTICAL. If omitted, report settings are used.

/minimize

Program starts in minimized mode. It is restored to normal mode on error or after ending execution (if /CloseWhenDone switch is not used).

/CloseWhenDone

Specifies, that the application is closed after successful executing of the specified operation (printing the report). This switch is used with /print or /ExportToFile switch.

/StaticPassword=<password for static report>

Specifies password for password protected static report.

report file|folder to print list of files from

Specifies full name of the report file to open or folder name to print list of files from (when /PrintFolder switch is used). This may be dynamic report (report template) or static report. Required. If the file name contains spaces, this parameter should be enclosed in quotes.

/VarNames=VariableName1%#%VariableName2%#%...

List of global report variables, which initial values must be overridden. Multiple items must be separated by %#% character combination. If the switch contains spaces, it should be enclosed in quotes. This switch must be used in conjunction with /Preview or /Print switches. See examples below.

/VarValues=VariableValue1%#%VariableValue2%#%...

List of initial values of global report variables. Multiple items must be separated by %#% character combination. The number of items in the list and their positions must match the ones from /VarNames switch. If the switch contains spaces, it should be enclosed in quotes.

Database related options

/changedb=<database name>

This option overrides the report Database option. Other database related options remains unchanged.

/changedbserver=<server name or IP address>

This option overrides the report Server option. Other database related options remains unchanged.

/changedbport=<port>

This option overrides the report Port option. Other database related options remains unchanged.

/UserName=<database user name>

Specifies database user name to access the report database (if the report database is remote database that requires user name to access it and the user name is not specified in the report template). If the switch contains spaces, the switch should be enclosed in quotes.

/Password=<database password>

Specifies database password to access the report database (if the report database is remote database that requires password to access it and the password is not specified in the report template). If the switch contains spaces, the switch should be enclosed in quotes.

/SQLParamNames=ParamName1%#%ParamName2%#%...

Can be used in cases, when report SQL text is a parameterized SQL query. SQL text of parameterized query contains parameter(s) for dynamic replacement; each parameter starts with colon, for example, :ITEMID, :PAYDATE and so on. SQL parameters are processed on database engine or database (for server databases) level. Use this switch to define a list of parameter names, which should be automatically replaced before the query execution. This list must contain parameter names (the colon must be omitted here) separated by %#% character combination. If the switch contains spaces, it should be enclosed in quotes. This switch must be used in conjunction with /SQLParamValues and /SQLParamTypes switches. See examples below.

/SQLParamValues=ParamValue1%#%ParamValue2%#%...

List of SQL parameter values separated by %#% character combination. The number of items in the list and their positions must match the ones from /SQLParamNames switch. To pass null value, text of the value should be NULL (in upper case). If the switch contains spaces, it should be enclosed in quotes.

/SQLParamTypes=ParamType1%#%ParamType2%#%...

List of SQL parameter types separated by %#% character combination. The number of items in the list and their positions must match the ones from /SQLParamNames switch. Available types: Boolean, Currency, Date, DateTime, Float, Integer, SmallInt, String, Time, Word. The switch should not contain spaces.

/SQLMacroNames=MacroName1%#%MacroName2%#%...

Can be used in cases, when report SQL text is an SQL query with macros. SQL text of such queries contains macro(s) for dynamic replacement; each macro starts with << and ends with >>, for example, <<ITEMID>>, <<PAYDATE>> and so on; unlike parameter, macro does not have a type and is always inserted as text. Use this switch to define a list of macro names, which should be automatically replaced before the query execution. This list must contain macro names (separators << and >> must be omitted here; macro name should contain only alphanumeric characters) separated by %#% character combination. The macros are processed before processing of parameters; therefore it is possible to use macros inside parameters. If the switch contains spaces, it should be enclosed in quotes. This switch must be used in conjunction with /SQLMacroValues switch. See examples below.

/SQLMacroValues=MacroValue1%#%MacroValue2%#%...

List of SQL macro values separated by %#% character combination. The number of items in the list and their positions must match the ones from /SQLMacroNames switch. If the switch contains spaces, it should be enclosed in quotes.

Report printing options

/print

Specifies, that the report must be printed.

/copies=<number of copies>

Specifies the number of copies to print (for example, /copies=4). If omitted, the report settings are used. This switch is used with /print switch.

/pages=<print pages>

Specifies pages to print. This should be a comma separated list of page numbers or page number ranges (for example, "/pages=1,2,10-24,37"). If omitted, all pages are printed. This switch is used with /print switch.

/collate

Specifies to collate print copies (when more than one copy). If omitted, current printer settings are used. This switch is used with /print switch.

/StretchPrint

Specifies, that the report must be printed in stretch print mode. If not used, the report is printed in own printer drawing mode (default). This switch is used with /print switch.

Report exporting options

/ExportToFile=<file name to export report to>

Specifies the name of the file to which the report must be exported.

/ExportFormat=<target export format>

Specifies target format for export. Possible values: STATIC, HTML, XLSX, XLS, PDF, TEXT, BITMAP, PNG, JPEG, GIF, or METAFILE. When omitted, the target format is based on the extension of /ExportToFile parameter. Default value is TEXT. This switch is used with /ExportToFile switch.

/ExportSeparatePages

Forces the export routine to separate pages in the target file (except STATIC and PDF). For graphic formats, a dark line is inserted between pages to separate them. For other formats, this works completely different: the separation is done by exporting Page header, Page footer, and Column header bands; when this key is omitted, first two bands are not exported, and Column header band is present only once. This switch is used with /ExportToFile switch.

/ExportGrayScale

Forces the export routine to convert export files to gray scale. Used only for image target formats. This switch is used with /ExportToFile switch.

/ExportPageStart=<number of starting page to export>

Specifies the starting page number for export. This switch is used with /ExportToFile switch.

/ExportPageEnd=<number of ending page to export>

Specifies the ending page number for export. This switch is used with /ExportToFile switch.

/ExportEncoding=<target export encoding>

Specifies the target encoding when exporting to file, for example, Windows-1251, UTF-8, ASCII etc. Used only for HTML target format. This switch is used with /ExportToFile switch.

/ExportLayout=<document layout type>

Specifies the layout type for the target document. Used only for HTML target format. Possible values: DIVISIONS (report objects are written using a series of HTML DIV tag) and TABLE (report objects are written using HTML TABLE tag). This switch is used with /ExportToFile switch.

/ExportTargetImageFormat=<target image format>

Specifies the format of target images. Used only for HTML target format. Possible values: PNG or JPEG. This switch is used with /ExportToFile switch.

/ExportTextSeparator=<target export field separator>

Specifies the field separator character when exporting to file. Used only for TEXT target format. Must be 1 symbol, for example, semicolon (;). Special characters like space or tab should be specified in the following format: #32 for space, #9 for tab and so on. Default value is #9. This switch is used with /ExportToFile switch.

/ExportLineSeparator=<target export line separator>

Specifies style of line terminator in destination file. Used only for TEXT and HTML target formats. Possible values: WINDOWS or UNIX. Default value is WINDOWS. This switch is used with /ExportToFile switch.

/ExportDocTitle=<target document title>

Specifies the target document title for HTML and PDF target formats. If not specified, the Document title property of Report object is used.

/ExportAuthor=<target document author>

Specifies the target document author for PDF target format. If not specified, the Author property of Report object is used.

/ExportHorzCellDiff=<target export horizontal object interval>

Horizontal difference in pixels between virtual table cells, on which the output is based. Used only for TEXT, HTML, and EXCEL target formats. Default value is 12. This switch is used with /ExportToFile switch.

/ExportVertCellDiff=<target export vertical object interval>

Vertical difference in pixels between virtual table cells, on which the output is based. Used only for TEXT, HTML, and EXCEL target formats. Default value is 8. This switch is used with /ExportToFile switch.

Examples

rptview.exe c:\MyReport.dtt

rptview.exe c:\MyReport.stt

rptview.exe "c:\My Documents\NewReport.dtt" /print /collate /copies=4 "/papersource=Tray 4" /closewhendone

rptview.exe "c:\My Documents\NewReport.dtt" /username=SYS /password=dio

rptview.exe "c:\report1.dtt" /SQLParamNames=PayerNo%#%PaymentDate /SQLParamTypes=Integer%#%Date "/SQLParamValues=345%#%10/10/2006"

rptview.exe "c:\payment.dtt" "/SQLMacroNames=PayerNumbers" "/SQLMacroValues=1025, 1037, 104"

rptview.exe "c:\payment.dtt" "/VarNames=OBJCOUNT%#%ANCHOR" "/VarValues=0%#%Today"

rptview.exe /PrintFolder /PrinterSetup c:\MyData

rptview.exe "c:\My Documents\NewReport.dtt" /ExportToFile=c:\export.htm /ExportFormat=HTML /PrinterSetup /CloseWhenDone

See Also

Reportizer Documentation: Report Data Source

Reportizer Documentation: Using SQL Queries

Database Tour Documentation: Opening Data Source

Database Tour Documentation: Working with SQL Queries