February 29, 2008, 02:32 AM
nubiFormatting Workarounds
Hi,
Ive had a request which i know isn't possible to do with native WebFOCUS code. I have a report which has an amount figure for various departments for a period but the amounbt figure for one account is actually a headcount where the rest are amounts of money. Therefore ive used a D11.2C format, but im being asked if i can set the number for the headcount to not have the currency sign yet keeping it in the same column:
at the moment mine looks like this:
account amount
overheads £199
headcount £150
wheras we'd like it like this:
account amount
overheads £199
headcount 150
and yes they do require it in the same column.
I know that formally it won't work using basic coding as the it defies the convention of the code but are there any work arounds you can think of?
February 29, 2008, 03:16 AM
Tony ANubi,
I don't know who told you that it can't be done in WF, because it can. It used to be documented in DS help files but I can't locate it in 7.1.6
Anyway, from my archives, I have an example that shows how the format of a column can be change depending upon the value of a BY field -
DEFINE FILE GGSALES
CFORMAT/A8 = IF ST EQ 'CA' OR 'CT' OR 'FL' THEN 'P18CBM'
ELSE IF ST EQ 'GA' OR 'IL' OR 'MA' THEN 'P18CB!E'
ELSE IF ST EQ 'MO' OR 'NY' OR 'TN' THEN 'P18CB!L'
ELSE IF ST EQ 'TX' THEN 'P18!Y' ELSE 'P18CBM';
MYDOLLARS/P18CB = DOLLARS;
END
-*
TABLE FILE GGSALES
SUM MYDOLLARS/CFORMAT
BY ST
HEADING
"Output Format Test"
""
ON TABLE NOTOTAL
ON TABLE SET PAGE-NUM NOPAGE
ON TABLE SET NODATA ''
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET STYLE *
UNITS=IN, PAGESIZE='A4', SQUEEZE=ON, ORIENTATION=LANDSCAPE,
LEFTMARGIN=0.3, RIGHTMARGIN=0.3, TOPMARGIN=0.3, BOTTOMMARGIN=0.3, $
TYPE=REPORT, GRID=ON, TOPGAP=0.02, BOTTOMGAP=0.02,
FONT='HELVETICA', SIZE=10, COLOR='BLACK', BACKCOLOR='NONE', STYLE=NORMAL, $
TYPE=HEADING, LINE=3, ITEM=2, WRAP=8.5, $
-*TYPE=SUBFOOT, HEADALIGN=INTERNAL, $
TYPE=REPORT, COLUMN=P2, WRAP=6, $
ENDSTYLE
END
Should be quite straight forward to understand ... I hope
T
February 29, 2008, 04:57 AM
nubiExcellent, thanks Tony A.
It's actually one of those solutions that makes you slap your head because its so obvious (well kind of) but which i'd have never have thought of on my own.
cheers!
February 29, 2008, 05:47 AM
Tony Aquote:
slap .... head
You've seen my photograph haven't you
February 29, 2008, 07:14 AM
nubihaha, haven't heard that phrase in a while.
thanks again.
February 29, 2008, 08:26 AM
mgrackinSounds like we need a new emoticon to represent a slap-head.
We could put Tony's picture on it!
February 29, 2008, 10:07 AM
Tony AMickey,
Remind me to visit you at Summit
T
February 29, 2008, 10:57 AM
RickWI find that dynamic format to be one of those hidden gems especially when you have a complex report with mixed numerics and alphas that have to line up.
March 03, 2008, 03:48 AM
nubiyeah im continually more and more impressed by these little tricks you can do with WF.