Sandbox

From CometWiki

(Difference between revisions)
Jump to: navigation, search
(New page: Comet Data Express is a utility program for Comet2003 and greater. This program provides a menu of the views and reports that have been defined, and provides a quick and convenient way to ...)
(playing)
Line 1: Line 1:
-
Comet Data Express is a utility program for Comet2003 and greater. This program provides a menu of the views and reports that have been defined, and provides a quick and convenient way to launch them with Crystal Reports and Excel.
+
'''Reporter Prompt Statement'''
-
Before using Comet Data Express, you must define your files with the DB Manager. Before using the Excel option, you must define your view(s) with the View Manager.
+
For some developers, Steve Auerbach's REPRPL pre-processor for the Reporter has become a valuable
 +
tool for providing the user a way to supply report-specific data values at
 +
runtime. We propose incorporating this ability into the Reporter itself and
 +
at the same time providing some additional flexibility.
 +
Here's an example of a report incorporating the Prompt statement:
-
== Using Comet Data Express ==
+
<pre>
 +
PROMPT caption "This string will appear as the caption of the prompt entry dialog"
 +
PROMPT %printer% 3 Printer name [LP2]
 +
PROMPT %cStart% 06 Starting customer number
 +
PROMPT %cEnd% 06 Ending customer number
 +
PROMPT %iStart% 08 Starting invoice date [01/01/04]
 +
PROMPT %iEnd% 08 Ending invoice date
 +
PROMPT %company% ENTER GETZZCO
 +
INPUT RECEIVABLES (%#%R1)
 +
TITLE RECEIVABLES FOR CUSTOMERS %cstart% TO %cend%
 +
TITLE WITH INVOICES DATES BETWEEN %istart% TO %iend%
 +
PRINTER %printer%
 +
KEYRANGE "%cstart%" TO "%cend%"
 +
REPORT
 +
DEFINE STINV.DATE.SEQ = DATE2NUM("%istart%",0);6.0
 +
DEFINE ENINV.DATE.SEQ = DATE2NUM("%iend%",0);6.0
 +
SELECTING IF AR.DATE.SEQ GE STINV.DATE.SEQ AND
 +
            AR.DATE.SEQ LE ENINV.DATE.SEQ
 +
USING R1.TO.C1A (%company%C1A)
 +
PRINT YADA, YADA, YADA
-
Please note that Comet Data Express requires that you have the following directories accessed:
+
</pre>
-
COS
+
Some examples:
-
TMP
+
-
There are three ways to start Comet Data Express:
+
PROMPT %1% 3 Printer name [LP2]
-
  1. Click on the "Comet Data Express" hyperlink in QMONITOR.
+
We would also eliminate some of the restrictions in the current solution.
-
  2. From the READY prompt, type DBX and press Enter.
+
The size of the replacement string (3 in the above example) can be any
-
  3. From the Comet Utility Programs menu, select item #37.  
+
numeric value.  It does not need to be exactly 2 digits. And the value
 +
immediately following the "%" is not limited to numbers. For clarity
 +
you could say something like:
-
Program options:
+
PROMPT %printer.name% 3 Printer name [LP2]
 +
...
 +
PRINTER %printer.name%
-
    * To display the list of reports for Crystal Reports, select the "Crystal Reports" tab.
+
We would also support the %# option that allows for specification of a
-
    * To display the list of views for Excel, select the "MS Excel" tab.
+
subprogram that would be ENTERed to provide the string replacement value.
-
    * To run the View Manager, click on the "View Manager" button.
+
We would allow for multiple of these just by following the %# with a name
-
    * To run the DB Manager, click on the "DB Manager" button.
+
or number such as:
-
    * To exit from the program, click the "Close" button.
+
-
'''Crystal Reports tab'''
+
%#company.name% ENTER GETZZCO
 +
...
 +
INPUT RECEIVABLES (%#company.name%R1)
-
The Crystal Reports tab contains the following options:
+
(Actually the word "ENTER" is redundant if we use the # to indicate an ENTERed
 +
program.  We can decide to drop either the # or the ENTER from the syntax.)
-
    * Preview Report
+
Now you can see the reason for the trailing "%".  In the above example you
-
    * Print Report
+
want the final INPUT statement to look something like:
-
    * Edit Report
+
 
-
    * Create Report
+
INPUT RECEIVABLES (MAR1)  ! the "MA" was supplied by the subprogram
-
    * Add
+
 
-
    * Remove
+
Use of the trailing % allows for string substitution to be done within
 +
another string.  Here's another example:
 +
 
 +
KEYRANGE "ABC%product%-00001" TO "ABC%product%-99999"
 +
could become
 +
KEYRANGE "ABC12345-00001" TO "ABC12345-99999"
 +
the user only needed to enter the "12345" portion of the string replacement.
 +
 
 +
PROMPT statements should be defined at the top of a report.  PROMPTs need
 +
not be only for the current report.  If the report runs another report in
 +
the same parition that requires string replacement the PROMPTs for all
 +
reports in the series can be placed at the top of the first report.
 +
 
 +
At runtime, the user will be prompted for all values defined by PROMPT
 +
statements.  The responses will be written to the #CPROMPT file on TMP.
 +
This file is keyed by PARTITION$ + PROMPT name.  Such as:
 +
 
 +
P00%5%
 +
P00%product%
 +
P00%#company.name%
 +
 
 +
As the report spec is interpreted, string fields will be parsed for a %..%
 +
pair.  If found, the #CPROMPT file will be read to see if there is a
 +
replacement defined for the %..% value.  If not found, the string will be used
 +
as is (thus allowing for data to actually contain % signs).

Revision as of 19:32, 26 August 2009

Reporter Prompt Statement

For some developers, Steve Auerbach's REPRPL pre-processor for the Reporter has become a valuable tool for providing the user a way to supply report-specific data values at runtime. We propose incorporating this ability into the Reporter itself and at the same time providing some additional flexibility.

Here's an example of a report incorporating the Prompt statement:


PROMPT caption "This string will appear as the caption of the prompt entry dialog"
PROMPT %printer% 3 Printer name [LP2]
PROMPT %cStart% 06 Starting customer number
PROMPT %cEnd% 06 Ending customer number
PROMPT %iStart% 08 Starting invoice date [01/01/04]
PROMPT %iEnd% 08 Ending invoice date
PROMPT %company% ENTER GETZZCO
INPUT RECEIVABLES (%#%R1)
TITLE RECEIVABLES FOR CUSTOMERS %cstart% TO %cend%
TITLE WITH INVOICES DATES BETWEEN %istart% TO %iend%
PRINTER %printer%
KEYRANGE "%cstart%" TO "%cend%"
REPORT
DEFINE STINV.DATE.SEQ = DATE2NUM("%istart%",0);6.0
DEFINE ENINV.DATE.SEQ = DATE2NUM("%iend%",0);6.0
SELECTING IF AR.DATE.SEQ GE STINV.DATE.SEQ AND
             AR.DATE.SEQ LE ENINV.DATE.SEQ
USING R1.TO.C1A (%company%C1A)
PRINT YADA, YADA, YADA

Some examples:

PROMPT %1% 3 Printer name [LP2]

We would also eliminate some of the restrictions in the current solution. The size of the replacement string (3 in the above example) can be any numeric value. It does not need to be exactly 2 digits. And the value immediately following the "%" is not limited to numbers. For clarity you could say something like:

PROMPT %printer.name% 3 Printer name [LP2] ... PRINTER %printer.name%

We would also support the %# option that allows for specification of a subprogram that would be ENTERed to provide the string replacement value. We would allow for multiple of these just by following the %# with a name or number such as:

%#company.name% ENTER GETZZCO ... INPUT RECEIVABLES (%#company.name%R1)

(Actually the word "ENTER" is redundant if we use the # to indicate an ENTERed program. We can decide to drop either the # or the ENTER from the syntax.)

Now you can see the reason for the trailing "%". In the above example you want the final INPUT statement to look something like:

INPUT RECEIVABLES (MAR1)  ! the "MA" was supplied by the subprogram

Use of the trailing % allows for string substitution to be done within another string. Here's another example:

KEYRANGE "ABC%product%-00001" TO "ABC%product%-99999" could become KEYRANGE "ABC12345-00001" TO "ABC12345-99999" the user only needed to enter the "12345" portion of the string replacement.

PROMPT statements should be defined at the top of a report. PROMPTs need not be only for the current report. If the report runs another report in the same parition that requires string replacement the PROMPTs for all reports in the series can be placed at the top of the first report.

At runtime, the user will be prompted for all values defined by PROMPT statements. The responses will be written to the #CPROMPT file on TMP. This file is keyed by PARTITION$ + PROMPT name. Such as:

P00%5% P00%product% P00%#company.name%

As the report spec is interpreted, string fields will be parsed for a %..% pair. If found, the #CPROMPT file will be read to see if there is a replacement defined for the %..% value. If not found, the string will be used as is (thus allowing for data to actually contain % signs).

Personal tools