SimpleCoversheet Command Line Interface

From Simple Wiki

SimpleCoversheet can be called from the command line to automatically print coversheets and optionally hide the interface. One can also add filters to database queries, and modify parameters stored in SQL statements by a configuration. Lastly, one can group elements from separate binding sources to create line item type functionality. Usage is as follows:

   SimpleCoversheet.exe [File Name] 
   SimpleCoversheet.exe [1]
   SimpleCoversheet.exe [File Name] [/print] [/hide]
   SimpleCoversheet.exe [File Name] [/filter:field_name=value] 
   [/param:@parameter_name=value] [/groupby:field_name]

Note: To include a space in a value use quotations to surround it. For different data types when using the filter and param switches you need to specify the proper enclosing characters; such as single quotes(‘) for string literals.

Options:

  • /print - Automatically print the coversheets from the specified configuration.
  • /hide - Hides the interface when /print is specified.
  • /filter:field_name=value - Adds a “WHERE field_name = value” clause to any SQL statements used in the configuration.
  • /param:@parameter_name=value - Replaces @parameter_name with value in any SQL statement used in the configuration.
  • /groupby:field_name - Groups a second binding sources values to a repeated value in a first binding source

Examples:

SimpleCoversheet.exe BarcodeSheet.xcs /print /hide

This command line will open the configuration name barcodesheet.xcs and then print all its pages without showing the SimpleCoversheet interface.

SimpleCoversheet.exe AddressLabels.xcs /filter:CITY=Knoxville

This command will add a ‘WHERE CITY = Knoxville’ clause to any SQL statement utilized in the configuration. Assume there is a Data Source Connection in AddressLabels.xcs, and there is a binding source that utilizes a table named tblCustomers that has all kinds of information necessary for printing address labels. Adding the clause specified above will cause SimpleCoversheet to only retrieve records from the table where the CITY field is equal to Knoxville.

SimpleCoversheet.exe Expirations.xcs /param:@expire_date=2010-09-10

Assume Expirations.xcs is bound to a query or view that has parameters, specifically a parameter named @expire_date, and that the query looks something like this:

   SELECT * FROM tblMaintenance WHERE EXPIRATION_DATE = ‘@expire_date’

Prior to retrieving the records from the database, SimpleCoversheet will replace the @expire_date in the select statement with the value specified on the command line so it ends up looking like this:

   SELECT * FROM tblMaintenance WHERE EXPIRATION_DATE = ‘2010-09-10’

SimpleCoversheet.exe LineItems.xcs /groupby:ORDER_NUMBER

This command line specifies that SimpleCoversheet should group all records in a second database with a repeated value in the ORDER_NUMBER column in relation with each unique ORDER_NUMBER column in a first database.

Assume there is a binding source mapped to a table named tblOrders with a record containing the value 467D-2839 in the ORDER_NUMBER column, and a second binding source mapped to a second table named tblOrderItems with 5 records containing 467D-2839 in the ORDER_NUMBER column. When SimpleCoversheet retrieves the values from the second binding source and table it will retrieve the records grouped by the value of the ORDER_NUMBER column in the first binding source.