49
CoolSpools Spool Converter User Guide V6R1
Page:
342
www.ariadnesoftware.co.uk
character itself.
Examples:
Pattern string
Denotes
$$PATTERN(XXX 999)
Three non-space characters followed by
2 spaces and then 3 numeric digits.
$$PATTERN(Totals for: 999999)
The string “Totals for:” followed by a
space and then 6 numeric digits.
$$PATTERN(999999 #9/99/99
################\.99)
Six numeric digits followed by 6 spaces
then a date (allowing for zero
suppression on the first digit) then 4
spaces then an edited number. Note the
use of # rather than 9 to allow for zero
suppression and the presence of
thousands separators and currency
symbols. Also note the backslash before
the period to indicate that the pattern is
checking for an actual period at that
position.
If you are familiar with regular expressions, you can use the $$REGEX CoolSpools
function to define even more powerful rules.
$$REGEX tests the value at a specified position on a line of text against a given
regular expression.
Refer to http://www.regular-expressions.info/ for information on regular expressions.
$$REGEX regular expressions are case-sensitive and support
Line section
You can also define this line as belonging to a section. Since sections cannot be
defined until their associated lines have been defined, you will need to do this later.
Leave the section name as *NONE at this time.
Saving the line definition
When you have finished defining the line, press F9 to save your changes.
You will be returned to the main screen. Any text lines on the page that now match a
line definition will be colored pink. Those that do not match a line definition will
remain their original color.
Press F13 and the name of the matching line definition will be displayed.
If for some reason a line of the report has been associated with the wrong line type
(for example, if you defined a line rule too broadly and lines were included that
should not have been), press F18 to undefine the line, i.e. disassociate it from the
line type. You can then press F10 on that line and define a new line type for it.
Alternatively, press F15 to work with report lines. You can then rename or modify the
existing line definitions or add new ones.
42
CoolSpools Spool Converter User Guide V6R1
Page:
343
www.ariadnesoftware.co.uk
Repeat the above steps until all lines in the report for which you wish to process data
have been correctly defined to and identified by CoolSpools. You do not need to
define blank lines and other lines that contain no data (e.g. banners and separators).
Command-line alternative
You can also add lines to a report definition using the ADDRPTLIN command.
Report lines can be changed with CHGRPTLIN, removed with RMVRPTLIN, copied
with CPYRPTLIN, displayed with DSPRPTLIN and renamed with RNMRPTLIN.
4. Define the report items for each line
Now that you have defined the lines, you need to define the data items those lines
comprise.
Position your cursor on a line which has already been defined and has a correctly
associated line type. Press F10 to work with that line.
You will see something like this. At the top of the screen there is part of the text line
on which you pressed F10. At the bottom are the details of the currently associated
line definition.
------------------------------------------------------------------------------
Change Report Line
*...+....1....+....2....+....3....+....4....+....5....+....6....+....
006 Customer: 000151 EVERGREEN & HARWOOD SEEDS
Line name . . . . . . . . CUSTOMER_HEADER
Text 'description' . . . Customer heading line
Line type . . . . . . . . *DETAIL
Can occur from page . . . *FIRST Offset . . . . . . . . . *NONE
Can occur to page . . . . *LAST Offset . . . . . . . . . *NONE
Can occur from line . . . 6 Can occur to line . . . . 50
Part of section . . . . . *NONE
Rule type . . . . . . . . *RULE
Rule eval priority . . . 100
Rel Line Off Pos Cmp Value
*IF *CURRENT *NONE 1 *EQ Customer:
More...
F3=Exit F4=List F9=Save F10=Define item F11=Items F19=Left F20=Right
------------------------------------------------------------------------------
Position your cursor on the text line at the top of the screen at the beginning of the
data item to be defined. If the data item is not shown because it is to the left or right
of the portion of the text line shown, use the F19=Left and F20=Right keys to window
the display left and right. When your cursor is at the beginning of the item, press F10
to define it. You will see something like this.
43
CoolSpools Spool Converter User Guide V6R1
Page:
344
www.ariadnesoftware.co.uk
------------------------------------------------------------------------------
Add Report Item
*...+....1....+....2....+....3....+....4....+....5....+....6....+....
006 Customer: 000151 EVERGREEN & HARWOOD SEEDS
^^^^^^
Report item name . . . .
Text 'description' . . .
Part of section . . . . . *LINE
Text 'description' . . .
Character position . . . 13 Character length . . . . 6
Item type . . . . . . . . *VAR Data type . . . . . . . . *NUMERIC
F3=Exit F4=List F9=Save F12=Cancel
------------------------------------------------------------------------------
The item definition consists of the following. If you position the cursor on a field that
has a limited number of possible values and press F4, you will be prompted with a
list of possible options.
Report item name
Specify a name for the report item. Report item names may be up to 20
characters long but otherwise confirm to the normal system i standards for object
naming.
If you leave any spaces inside the name, they will automatically be converted to
underscores.
Text ‘description’
Give the item some descriptive text. If no text is specified, it is automatically
derived from the item name. Specify *BLANK if you want the text left blank.
Part of section
Identifies the section to which the item belongs.
This defaults to *LINE indicating that the item is part of the section associated
with the line to which the item belongs, but can be changed to a different section
name where appropriate (if a line contains items belonging to more than one
section). We will define sections later, so for now leave this as *LINE.
Character position
The character position (column) at which the data item starts on the line. This will
automatically have been defaulted by CoolSpools to the cursor position at which
you pressed F10.
55
CoolSpools Spool Converter User Guide V6R1
Page:
345
www.ariadnesoftware.co.uk
Character length
The number of characters the data item includes starting from and including the
character position specified above.
Note that where the item that that is being defined is a number, be careful to
include the character positions occupied by:
o
digits at the beginning of the number which might not be apparent on
the text line you selected because of zero suppression but which
might be present on other lines where the value of the data item is
larger.
o
trailing minus signs at the end of the number which might not be
apparent on the text line you selected because it is positive but which
might be present on other lines where the value of the data item is
negative.
CoolSpools will default the length to a value calculated by counting characters to
the right from the cursor position at which you pressed F10, stopping at and
excluding the first space following the first block of non-space characters. Make
sure you check that this length is correct, which it will not be, for example, if the
data item you are defining includes embedded blanks.
The characters currently selected for the data item are shown by means of a set
of ^ symbols under them.
Item type
Specify the type of item being defined:
o
*VAR
The item is a variable
o
*CONST
The item is a constant
o
*LABEL
The item is a label (text associated with a variable).
CoolSpools will default this to *VAR.
The distinction between these types is of no great significance at this time but
may be used by future features.
Data type
Specify the type of data the item consists of:
o
*ALPHA
Alphanumeric
o
*NUMERIC Numeric
o
*DATE
Date
CoolSpools will default this to a value derived from the value of the item on the
current text line at the position identified when you pressed F10. Check that this
C# Word - Word Conversion in C#.NET Word documents in .NET class applications independently, without using other external third-party dependencies like Adobe Acrobat. Word to PDF Conversion.
convert password protected pdf files to word online; crystal report to pdf with password
62
CoolSpools Spool Converter User Guide V6R1
Page:
346
www.ariadnesoftware.co.uk
is correct, which it might not be, for example, for an alphanumeric variable where
the current value happens to consist of only numeric characters.
Date format
Where *DATE was specified for the data type, specify the format of the date this
data item consists of:
o
*RPTDFN Date format associated with the report definition.
o
*JOB
Current job date format
o
*SYSVAL Date format identified by the QDATFMT system
value.
o
*YMD
Year-month-day
o
*MDY
Month-day-year
o
*DMY
Day-month-year
CoolSpools defaults this field to *RPTDFN.
Date separator
Where *DATE was specified for the data type, specify the separator character
used to edit the date this data item consists of:
o
*RPTDFN Date separator associated with the report definition.
o
*JOB
Current job date format
o
*SYSVAL Date format identified by the QDATFMT system value.
o
*NONE
No separator character
o
sep_char
Specify the separator character used.
CoolSpools defaults this field to *RPTDFN.
Saving the item definition
When you have finished defining the item, press F9 to save your changes.
You will be returned to the main screen.
Repeat the above steps until all items on all lines in the report for which you wish to
process data have been correctly defined to and identified by CoolSpools. You do
not need to define blank areas of the page or other items that contain no data (e.g.
banners and separators) or which contain data which you do not require to be
included in files created from this report definition.
Command-line alternative
You can also add items to a report definition using the ADDRPTITM command.
Report items can be changed with CHGRPTITM, removed with RMVRPTITM, copied
with CPYRPTITM, displayed with DSPRPTITM and renamed with RNMRPTITM.
5. Define the report sections
What is a report section?
Now that you have defined the lines and the items they comprise, you need to define
the section structure of the report.
44
CoolSpools Spool Converter User Guide V6R1
Page:
347
www.ariadnesoftware.co.uk
Most reports have some kind of section structure, and it is important that CoolSpools
knows about this structure in order to be able to create meaningful output from your
report, for example XML documents where elements are nested correctly.
For example, in the case of the demo Customer Order Report DM_ORDRPT1 (see
above), the report lists orders for a given date range by customer, within US state, by
region of the USA. There are therefore 3 sections that CoolSpools needs to know
about and these form the following section hierarchy:
Region
¦
State
¦
Customer
The region section of the report comprises one or more states and each state shown
in the report comprises one or more customers.
If, for example, you want CoolSpools to be able to build an XML document from the
report which takes the following form:
<region>
<state>
<customer/>
<customer/>
<customer/>
</state>
<state>
<customer/>
<customer/>
</state>
</region>
...
etc.
then CoolSpools needs to know how sections relate to one another and when each
section starts and ends.
Sections define the relationship between the various lines in a report. In general,
where two lines in the report are related to one another, and may need to be handled
as a unit, they should be defined as being part of the same section, or as being part
of different sections that are themselves related in terms of a section hierarchy. For
example, if the order information for each order in the Customer Order Report were
to cover two lines, those lines should be defined as making up an order section.
CoolSpools can then treat the two lines as a single entity and correctly process the
data for a single order from both lines together (e.g. outputting that data to a single
XML element or Excel row).
48
CoolSpools Spool Converter User Guide V6R1
Page:
348
www.ariadnesoftware.co.uk
Defining report sections
To define a section, press F11 anywhere on the report.
You will see something like this.
------------------------------------------------------------------------------
Add Section
Section name . .
Text 'description'
Parent section . . *NONE Section type . . *DETAIL
Start line name . End line name . . *NEXTSTART
End line in sect . *YES End rules same . . *NO
--------------------------- Section Start Rules ------------------------------
Rel Item name Cmp Value
*IF
More...
---------------------------- Section End Rules -------------------------------
Rel Item name Cmp Value
*IF
More...
------------------------------ Included Lines --------------------------------
More...
F3=Exit F4=List F9=Save F11=Work with lines F12=Cancel
------------------------------------------------------------------------------
If you position the cursor on a field that has a limited number of possible values and
press F4, you will be prompted with a list of possible options.
Specify the following basic information for the line:
Section name
Specify a name for the report section. Report section names may be up to 20
characters long but otherwise confirm to the normal system i standards for object
naming.
If you leave any spaces inside the name, they will automatically be converted to
underscores.
Text 'description'
Give the section some descriptive text. If no text is specified, it is automatically
derived from the section name. Specify *BLANK if you want the text left blank.
Parent section
Specify what kind of line it is, e.g.:
Parent section
This field allows the creation of a section hierarchy. If you specify the name of
another section here, the section you are defining will be a child section of that
parent section.
58
CoolSpools Spool Converter User Guide V6R1
Page:
349
www.ariadnesoftware.co.uk
The default is *NONE which indicates a top-level section with no parent.
Parent section
What type of section this is:
o
*DETAIL
A report detail section
o
*PAGHDG A page heading section
o
*COLHDG A column heading section
o
*SUMMARY A summary section (e.g. totals)
o
*REPORT A report-level section (comprising the entire report)
o
*OTHER
Some other type of section
This item is not important at this time but may be used by future features.
Start line name
Specify the name of the line which starts the section. For example, in the case of
the CUSTOMER section in the Customer Order Report, it is the line type called
CUSTOMER_HEADER which marks the start of a group of lines for a new
customer.
End line name
Specify the name of the line which ends the section. For example, in the case of
the CUSTOMER section in the Customer Order Report, it is the line type called
CUSTOMER_TOTAL which marks the end of a group of lines for a customer.
The default is *NEXTSTART, which indicates that the end a section of this type
can only be determined by the occurrence of the next start line (as defined
above). For example, the CUSTOMER section could equally (but less elegantly
and accurately) be defined as starting with CUSTOMER_HEADER and ending
with the next CUSTOMER_HEADER.
End line in section
Whether the line specified as the end line for the section should be included in
the section or not:
o
*YES The end line is part of the section it ends. For example, the
CUSTOMER_TOTAL line is part of the CUSTOMER section it
ends.
o
*NO
The end line is not part of the section it ends. For example,
where *NEXTSTART is defined for a section, the end line is
not part of the section, but rather the start of the next section
of the same type.
End start rules same
Whether, when section rules need to be defined, the same rules apply both to the
ending of the section as to the starting of the section, or whether different rules
need to be defined for each.
72
CoolSpools Spool Converter User Guide V6R1
Page:
350
www.ariadnesoftware.co.uk
o
*YES Only one set of rules needs to be defined.
o
*NO
Two sets of rules will be defined
Section rules
Sometimes, start and end line types on their own are not enough to identify the
beginning or end of a section.
For example, in the sample Customer Order Report, the REGION section can span
many pages and each page starts with a region header reiterating the current region
code and name. While the REGION_HEADER line is indeed the start line for the
REGION section, not every REGION_HEADER line starts a new region section. We
need to use a section rule to identify the true start of a new section. Specifically, a
new region section starts with a REGION_HEADER line where the region code is
different from the previous region code.
Section rules are similar to line rules and consist of one or more tests which
comprise the options.
“
R
el” (Relationship)
This identifies the relationship between each test. Options are:
o
*IF
This value is mandatory on the first line and is possible only
on the first line.
o
*AND Indicates that this test is part of an AND group with the
previous line. The rule will be true only if the result of all tests
in an AND group is true.
o
*OR
Indicates that this test starts a new OR group. The rule will be
true if the combined result of any OR group is true.
Item name
Specifies the name of a report item to be tested.
Press F4 to select the item from a list of items defined for the report.
Cmp (Comparison type)
Specifies the type of comparison to be applied. Options are:
o
*EQ
The rule is true if the value of the report item to be tested is
equal to the comparison value.
o
*NE
The rule is true if the value of the report item to be tested is
not equal to the comparison value.
o
*GT
The rule is true if the value report item to be tested is greater
than to the comparison value.
o
*LT
The rule is true if the value report item to be tested is less
than to the comparison value.
o
*GE
The rule is true if the value report item to be tested is greater
than or equal to the comparison value.
o
*LE
The rule is true if the value report item to be tested is less
than or equal to the comparison value.
Value (comparison value)
Documents you may be interested
Documents you may be interested