Focal Point
align decimal columns

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

April 28, 2005, 04:13 PM
Kamesh
align decimal columns
Problem with aligning decimal columns.

For example:
Amt/P17.2CM=Amount;


when you try display this field, it's not getting aligned properly.

Record1
Name : XXXXXX
Salary : $5000

Record2
Name : XXXXXX
Salary : $100000

Record3
Name : XXXXXX
Salary : $1

The report should be look like

Name : XXXXXX
Salary : $5000

Name : XXXXX
Salary : $100000

Name : XXXXX
Salary : $1

tried align by LEFT justify but this field is occupying 20 columns and it's going extreme end.
April 28, 2005, 04:15 PM
Kamesh
the example I gave in my previous post, the spaces it didn't show

not aligned report sample for the previous example
Name : XXXX
Salary :----$1000

gave '-' instead of spaces
April 28, 2005, 04:32 PM
Francis Mariani
Try this:

TABLE FILE CAR
SUM
COMPUTE RECORD/P4 = RECORD + 1; NOPRINT
COMPUTE SALESX/P17.2CM = SALES; NOPRINT
BY CAR NOPRINT
BY MODEL NOPRINT
ON MODEL SUBHEAD
"RECORD: <RECORD"
"COUNTRY: <COUNTRY"
"SALES: <SALESX"
WHERE READLIMIT EQ 100
WHERE RECORDLIMIT EQ 100
HEADING
" "
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLESHEET *
TYPE=REPORT, GRID=ON,
FONT='VERDANA', SIZE=8, $
TYPE=SUBHEAD, HEADALIGN=BODY, $
TYPE=SUBHEAD, LINE=3, ITEM=2, COLOR=RED, JUSTIFY=RIGHT, $
ENDSTYLE
END
April 28, 2005, 04:39 PM
reFOCUSing
Try this:

DEFINE FILE SHORT
BALANCE/D14.2=BALANCE;
END
TABLE FILE SHORT
BY COUNTRY NOPRINT SUBHEAD
"Country:"Type:"Holder:ON TABLE SET PAGE-NUM OFF
ON TABLE SET ONLINE-FMT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLESHEET *
TYPE=REPORT, FONT='TIMES', $
TYPE=REPORT, GRID=OFF, $
TYPE=SUBHEAD, ITEM=1, WIDTH=1.00, JUSTIFY=RIGHT, $
TYPE=SUBHEAD, ITEM=2, WIDTH=1.25, JUSTIFY=RIGHT, $
TYPE=SUBHEAD, ITEM=3, WIDTH=1.25, JUSTIFY=RIGHT,$
TYPE=SUBHEAD, ITEM=4, WIDTH=1.5, JUSTIFY=DECIMAL(.6),$
ENDSTYLE
END[/code]The 'JUSTIFY=DECIMAL(.6),' in the style sheet is what does the trick.

If you want more information on this check out the following doc on the tech support site:
'Aligning Content in a Multi-Line Heading or Footing'

This message has been edited. Last edited by: <Mabel>,
April 28, 2005, 07:47 PM
Kamesh
tried JUSTIFY=DECIMAL(.6) but not working.

My code will look like,

TABLE FILE TEST
PRINT DESCRIPTION
BY ACCTID PAGE-BREAK
ON ACCTID SUBHEAD
"ACCOUNT NUMBER <9 <ACCTID "
"AMOUNT <9 <ST.AMOUNT "
END

The Amount field is messing up the alignment. tried,
TYPE=SUBHEAD,LINE=2,JUSTIFY=DECIMAL(.6),WIDTH=1.5,BY=ACCTID,$

but not working.
April 28, 2005, 07:55 PM
Francis Mariani
What's not working? What is it you want to do, exactly?

Do you want the AMOUNT field to left-align with the ACCTID field?

Do you want all the AMOUNT fields to be right-justified?

DO you want all the fields (AMOUNT and ACCTID) to be right-justified?

We could better serve you if you post a program that we can run on our machines.

Why not use the CAR file to post an example that we can build on?
April 28, 2005, 09:04 PM
Kamesh
Acctid and Amount has to be left justified.