Command Line Operation - Settings and Examples
Format for running a report from the command line:
"C:\Program Files\Easy View\EasyView.exe" CMD OPT1=Setting1, OPT2=Setting2, OPT3=Setting3
Command Sections:
- The first section is always the full path to EasyView.exe. This is normally
C:\Program Files\Easy View\EasyView.exe.
- The next section is always 'CMD'. This tells Easy View to expect more settings.
- The final section is the settings. These can vary depending on how the
report will be run.
Options:
General Options
- R - Report File
- Full path to the report file you want to run. (e.g. C:\MyReport.rpt)
- M - Run Mode
- P - Preview Mode (default)
- Q - Quick Print Mode
- E - Export Mode
- S - Run a Scheduled Report
- MAN - Manual Mode
- 0 - Run in automatic mode and do not prompt users for passwords etc.
(default)
- 1 - Run in manual mode. User will be prompted when required
- SN - Schedule Name
- Specify the name of the schedule to run. A list of possibilities can
be found in the 'Report Scheduler' tab.
- FILE - A configuration file can be used instead of specifying
all of the commands at the command line.
- Full path to the configuration file. (e.g. C:\MyConfig.clo)
- DD - Discard saved report data
- 0 - Don't clear any data saved in the report
file.
- 1 - Clear all data saved in the report
file. (default)
- REF - Refresh interval
- Sets a refresh interval in seconds for a report to refresh it's data. Only applies to preview mode.
- SM - Show messages when running report from command line
- 0 - Don't show messages
- 1 - Show messages (default)
Login Settings
- SV - Database server name
- Name of the database server or DSN name.
- DB - Database name
- Name of the database you want to use.
- UN - User name
- The user name used to login to a database.
- PW - Password
- The password used to login to a database.
Report Parameters
You can enter as many parameter values as you need from the command line. Parameter values can be entered by the Parameter name or the parameter number.
The preferred method is to use the parameter name.
Parameter values by name:
The format for entering the parameter values by name is
P[YourParam]=YourValue. The section between the [ and ] should match a
parameter name in your Crystal Report file exactly.
If you are not sure what the parameter names are, you can run the report from
the Quick Launch window and note the names on the parameter screen.
Parameter values by number:
The format for entering the parameter values by name is
P1=YourValue1,P2=YourValue2,P3=YourValue3 .... The only limit to the
number is the number of parameters in the report file. If you use this method make sure the
parameter numbers match the order of the parameters you see in the parameter screen
when run manually exactly.
Parameters with multiple values:
If a report has a parameter that allows for multiple values in a parameter you
can enter the same parameter more than once with a different value each time.
P[PartNumber]=Value1,P[PartNumber]=Value2,P[PartNumber]=Value3..... or
P1=Value1,P1=Value2,P3=Value3.....
Parameters with range values:
If a report has a parameter that requires a range value you can enter it like
this
P[YourParam]=[StartValue][EndValue] or
P1=[StartValue][EndValue]. The first set of brackets contains the
start value. The second set of brackets contains the end value.
Parameters with variables:
If you are using a variable with a parameter you need to substitute the <> with (). The <> are not legal characters in a command line string.
Examples:
<Date> should be replaced with (Date)
[<Date-7>][<Date>] should be replaced with [(Date-7)][(Date)]
Printing Options
- P - Print
out the report
- 0 - Don't print a copy of the report. (default)
- 1 - Print a copy of the report.
- C - Print Copies
- Set the number of copies to print. (default is 1)
- SP - Select Printer
- 0 - Do not bring up a dialog to select a printer. The default printer will
be used. (default)
- 1 - Bring up a dialog to select a printer. This is not
recommended because the report will not be run until a user selects a printer.
- PRT - Sets the name of the printer to use
- Use this option to set the name of a printer. The default Windows printer
will be used if left blank.
General Export Options
- F - Export File
- Full path to the export file name. (e.g. C:\MyReport.pdf)
- E - Export Format
(Using the format number is preferred but the text can be used also. Example:
E=0 for PDF format)
- 0 - Acrobat Format (PDF)
- 1 - Character Separated Values
- 2 - Crystal Reports (RPT)
- 3 - HTML 4.0
- 4 - MS Excel 97-2000
- 5 - MS Excel 97-2000 (Data Only)
- 6 - MS Word
- 7 - Rich Text Format
- 8 - Rich Text Format (Editable)
- 9 - Tab-separated text
- 10 - Text
- 11 - Text (Paginated)
- 12 - XML
- O - Overwrite File
- 0 - Don't overwrite the export file if it already
exists. The file will be given a new name (e.g. Export(1).pdf). (default)
- 1 - Always overwrite the export file if it exists.
- ENC - Encrypt Export File
- 0 - Normal export format. (default)
- 1 - Encrypt the export file using the selected format.
- DEL - Delete the exported file when finished (only applies when the file is emailed)
- 0 - Don't delete the file. (default)
- 1 - Delete the file after sending the email.
- AP - Pages to export
- 0 - Don't export all pages in the report. (Used with FP and LP options)
- 1 - Export all pages in the report. (default)
- FP - First page to be exported
(Only used when AP=0)
- Number of the first page to be exported.
- LP - Last page to be exported
(Only used when AP=0)
- Number of the last page to be exported.
HTML Export Options
- HM - Break up into multiple HTML files
- 0 - The entire report will be exported into 1 HTML
file. (default)
- 1 - Each page of the report will be exported into
individual HTML files.
- HN - Page navigators
(only used when HM=1)
- 0 - Don't insert hyperlinks to navigate from page
to page. (default)
- 1 - Insert hyperlinks to navigate from page
to page.
- HE - Embed HTML file into the email body
(only used when S=1 and HM=0)
- 0 - Don't embed the HTML file into the body of the
email. (default)
- 1 - Embed the HTML file into the body of the email.
XML Export Options
- XM - Allow multiple XML files
- 0 - Don't allow multiple XML files.
- 1 - Allow multiple XML files to be created when required. (default)
Excel Export Options
- EC - Constant column width
- 0 - Don't use constant column widths. (works together
with EA)
- 1 - Use constant column widths. (default) (works
together with EW)
- EW - Column width (Used when EC=1)
- Column with in points (default is 48)
- EA - Area type (Used when EC=0)
- 1 - Report Header
- 2 - Page Header
- 3 - Group Header
- 4 - Detail (default)
- 5 - Group Footer
- 7 - Page Footer
- 8 - Report Footer
- ED - Convert date to string
- 0 - Don't convert date values to strings. (default)
- 1 - Convert date values to strings.
- EP - Page breaks
- 0 - Don't insert page breaks into file.
- 1 - Insert page breaks into file. (default)
- EH - Tab has column headings
- 0 - No column headings on tabs.
- 1 - Column headings on tabs. (default)
- ET - Tabular format
- 0 - Don't use tabular format. (default)
- 1 - Use tabular format.
- EF - Worksheet Functions
- 0 - Don't use worksheet Functions. (default)
- 1 - Use worksheet Functions.
- EG - Show Grid Lines
- 0 - Hide grid lines in the Excel file. (default)
- 1 - Show grid lines in the Excel file.
Excel (Data Only) Export Options
- EEI - Export Images
- EEHF - Export Page Header and Page Footer
- EMCA - Maintain Column Alignment
- EUWF - Use Worksheet Functions For Summaries
- EEOF - Export Object Formatting
- ESPH - Simplify Page Headers
- EMRP - Maintain Relative Object Position
- ESGO - Show Group Outlines
Text Export Options
- TCPI - Characters Per Inch (default is 12)
- TLPP - Number Of Lines Per Page (default is 60)
Character Separated Values (CSV) Export Options
- CFD - Field Delimiter (default is ,)
- CSD - String Delimiter (default is ")
- CGS - Group Sections
- 0 - Export (default)
- 1 - Export Isolated
- 2 - Do Not Export
- CRS - Report Sections
- 0 - Export (default)
- 1 - Export Isolated
- 2 - Do Not Export
PDF Export Options
- PCB - Create Bookmarks From Group Tree
Editable RTF Export Options
Email Settings
- S - Send Email
- 0 - Don't send email. (default)
- 1 - Send email.
- TO - Email "To" Recipient
- Email addresses of any recipients for the "To:" box. (e.g. user@mail.com;
user2@mail.com)
- CC - Email "Cc" Recipient
- Email addresses of any recipients for the "Cc:" box. (e.g.
user@mail.com; user2@mail.com)
- BCC - Email "Bcc" Recipient
- Email addresses of any recipients for the "Bcc:" box. (e.g.
user@mail.com; user2@mail.com)
- SUB - Email Subject
- Subject text of the email.
- MSG - Email Message
- Message body of the email.
- If you want to add line breaks into the message body you must use \n
where you want each carriage return.
- If you want to add a comma into the message body you must use \c
where you want each comma.
- T - Email Type
- MAPI - Send the email using MAPI. (default)
- SMTP - Send email using the specified SMTP server.
- CNF - Request user confirmation before sending email.
- MAPI - No (default)
- SMTP - Yes
- ARF - Send attachment
- 0 - Don't attach the exported file to the email.
- 1 - Attach the exported file to the email. (default)
Examples:
- Preview:
"C:\Program Files\Easy View\EasyView.exe" CMD R=C:\BlankReport.rpt
- Quick Print:
"C:\Program Files\Easy View\EasyView.exe" CMD M=Q,R=C:\BlankReport.rpt
- Optional:
- C=2 - Number of copies to print. (default is 1)
- SP=1 - Select the printer (default is 0) (only works when MAN=1)
- Prt=SomePrinterName (overrides the default Windows printer)
- Export:
"C:\Program Files\Easy View\EasyView.exe" CMD M=E,R=C:\BlankReport.rpt,E=MS Word,F=C:\BlankReport
- Optional:
- P=1 - Send report to printer. (default is 0)
- C=2 - Number of copies to print. (default is 1)
- O=1 - Overwrite an existing export file. (default is 0)
- Del=1 - Delete the file when the export is completed. (default is 0)
- AP=0 - Don't export all pages. (default is 1)
- FP=1 - First page to export.
- LP=9 - Last page to export.
- Export with email:
"C:\Program Files\Easy View\EasyView.exe" CMD M=E,R=C:\BlankReport.rpt,S=1,E=MS Word,F=C:\BlankReport,To=user@mail.com,Sub=Mail Subject,Msg=Hi Bob/c/nHere is the file./nThanks/c/nSteve
(Use a /c in place of any comma in the message. Use a /n in place of any carriage return.)
- Optional:
- T=SMTP - Set the email handler to an SMTP server.
- P=1 - Send report to printer. (default is 0)
- C=2 - Number of copies to print. (default is 1)
- O=1 - Overwrite an existing export file. (default is 0)
- Del=1 - Delete the file when the export is completed. (default is 0)
- AP=0 - Don't export all pages. (default is 1)
- FP=1 - First page to export.
- LP=9 - Last page to export.
- From Config File :
"C:\Program Files\Easy View\EasyView.exe" CMD File=C:\Mail.clo
- If you add any of the options to this one it will override the corresponding
setting in the config file.
Changing the separator character: You can change the
default separator character from a comma to another character by modifying
the command line settings.
Examples:
Before:
"C:\Program Files\Easy View\EasyView.exe" CMD M=Q,R=C:\BlankReport.rpt
After: "C:\Program Files\Easy View\EasyView.exe" CMD [!] M=Q!R=C:\BlankReport.rpt
This example changes the separator character from the default comma to an
exclamation mark. This setting can be changed to any single character as long
as it does not violate any Windows command line rules (like using < or > for
example). The character must be the first setting after the CMD text and be
surrounded by [ on the left and ] on the right.
<< Previous - Next >>