Focal Point
printing two columns in a single column

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3011009331

September 23, 2005, 08:32 AM
Dharma
printing two columns in a single column
suppose iam getting three fields from stored procedure 'fld1', 'fld2' and 'fld3'. i want to print all these three under the same column 'Description'. right now iam writing the following code:

COMPUTE COM_FLD/A255 = FLD1 || (' ' | FLD2) || (' ' | FLD3); AS 'Description'

but actually i want to display FLD2 and FLD3 in next line in the same row. i want something like this:

Description
-----------

FLD1
FLD2 FLD3 (first row)

FLD11
FLD22 FLD33 (second row)

any idea how to do this?
September 23, 2005, 08:59 AM
<Steve Cowell>
Dharma
You can use OVER to accomplish this. DEFINE a field concatenating fields two and three as 'D_CONCAT_FIELD' then in your TABLE.

PRINT FIELD_ONE AS '' OVER D_CONCAT_FIELD AS ''

Hope this helps

Steve C
September 23, 2005, 02:34 PM
Noreen Redden
Another way to do this, is to make the second line be a SUBFOOT. First, if you don't have a normal BY field, make one up:
DEFINE FILE fn
CTR/I9 WITH FIELD_ONE = CTR + 1;
END
TABLE FILE fn
PRINT FIELD_ONE AS 'Description'
BY CTR NOPRINT
ON CTR SUBFOOT
"<FIELD_TWO <FIELD_THREE "
END

You can do this all through the GUI, and if you have other verb objects for the first line, just put them in before the CTR, and if you have another BY field, most likely you won't have to do the DEFINE CTR at all.