Focal Point
[CLOSED] Row Formats in Stylesheet

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

December 20, 2011, 01:51 PM
Todd Jones
[CLOSED] Row Formats in Stylesheet
I have one column named January it is in D20.2 format. I need specific rows in different formats:
Miles should be /D20C
Price / Gallon = /D20.2M
Gas Cost = /D20M
Percent of Something = /D20.2%

How can this be done?

January
Miles 50,000
Price / Gallon $3.45
Gas Cost $172,500
Percent of 51.25%
Something



FOUND THE ANSWER....
DEFINE FILE NUMBERS
NR9/P20.9 = NUMBER ;
NR8/P20.8 = NR9 ;
NR7/P20.7 = NR8 ;
NR6/P20.6 = NR7 ;
NR5/P20.5 = NR6 ;
NR4/P20.4 = NR5 ;
NR3/P20.3 = NR4 ;
NR2/P20.2 = NR3 ;
NR1/P20.1 = NR2 ;
NR0/P20.0 = NR1 ;
FORMATX/A8 = IF (NR8 NE NR9) THEN 'D20.9' ELSE
IF (NR7 NE NR8) THEN 'D20.8' ELSE
IF (NR6 NE NR7) THEN 'D20.7' ELSE
IF (NR5 NE NR6) THEN 'D20.6' ELSE
IF (NR4 NE NR5) THEN 'D20.5' ELSE
IF (NR3 NE NR4) THEN 'D20.4' ELSE
IF (NR2 NE NR3) THEN 'D20.3' ELSE
IF (NR1 NE NR2) THEN 'D20.2' ELSE
IF (NR0 NE NR1) THEN 'D20.1' ELSE 'D20.0';
END
-*
TABLE FILE NUMBERS
PRINT
NUMBER
NUMBER/FORMATX
END

This message has been edited. Last edited by: Kerry,


7.6.8
UNIX
FOCUS,HTML,PDF,EXCEL.
December 20, 2011, 05:37 PM
David Briars
Hi Todd,

Take a look at Dynamic Formatting.

For example:
APP PREPENDPATH IBISAMP
-*
DEFINE FILE GGSALES
 FLDFMT/A8 = DECODE SEQ_NO (1 'D12M'
                            2 'D12.2'
                            3 'I8:L'
                            4 'I8:Y');
END
TABLE FILE GGSALES
PRINT SEQ_NO
      UNITS
      UNITS/FLDFMT
IF SEQ_NO LE 4
END


Yields:

PAGE 1 
 
Sequence# Unit Sales Unit Sales 
1         1387       $1,387 
2         1729        1,729.00 
3         1698        £1,698 
4         1669        ¥1,669 

Dave




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
December 20, 2011, 07:51 PM
njsden
quote:
'I8:L' and 'I8:Y'


Nice! I don't think I was aware of those modifiers to the data type to get different currency symbols. Very useful! Thanks David.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.