I have seemingly the simplest task, but I can't get it done. I want to conditionally indent certain rows. Something like the 2 rows in the middle in the following example:
JAGUAR 12000 JENSEN 0 TRIUMPH 0 PEUGEOT 0
I read some other posts in the forum. All of them suggest adding leading spaces to the value. However, I can't do that because later I need to add drill-down to the first column of the detail rows, and having the leading spaces in the drill-down hyperlinks make the report look ugly.
Are there any other ways to do indentation?This message has been edited. Last edited by: Kerry,
WebFOCUS 7.7.3 Windows, All Outputs
October 10, 2012, 01:00 AM
Waz
Not knowing the layout of the report, its difficult to suggest something.
But have you thought about adding a blank column prior to the field to be indented ?
Another option is to create the drilldoen in the field with some html and javascript.
There will be many other ways to do this as well.
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
October 10, 2012, 07:38 AM
Diane
What about using subhead for the first column?
WebFOCUS 8.1.0.5m
October 10, 2012, 09:13 AM
RRKen
conditional justification? You could right justify the columns you want indented?
8.2.03 AIX Client Windows Tomcat DB2, Terradata, SQL, Oracle
October 10, 2012, 09:29 AM
Doug
Something like this?
TABLE FILE CAR
SUM DCOST NOPRINT
BY COUNTRY NOPRINT
ON COUNTRY SUBFOOT
"<COUNTRY> <DCOST>"
ON TABLE SET HTMLCSS ON
ON TABLE SET PAGE OFF
ON TABLE SET STYLE *
GRID=OFF, BORDER=OFF, SQUEEZE=OFF,$
TYPE=SUBFOOT, ITEM=1, OBJECT=FIELD, WRAP=1.50, POSITION=0.20, JUSTIFY=LEFT, COLOR=RED, WHEN = COUNTRY EQ 'FRANCE',$
TYPE=SUBFOOT, ITEM=2, OBJECT=FIELD, WRAP=1.50, POSITION=0.10, JUSTIFY=RIGHT, COLOR=BLUE, WHEN = COUNTRY EQ 'FRANCE',$
TYPE=SUBFOOT, ITEM=1, OBJECT=FIELD, WRAP=1.50, POSITION=0.00, JUSTIFY=LEFT, COLOR=BLUE, WHEN = COUNTRY NE 'FRANCE',$
TYPE=SUBFOOT, ITEM=2, OBJECT=FIELD, WRAP=1.50, POSITION=0.25, JUSTIFY=RIGHT, COLOR=BLUE, WHEN = COUNTRY NE 'FRANCE',$
ENDSTYLE
END
October 10, 2012, 10:42 AM
Wep5622
Or add a CSS-class conditionally, assuming you're using HTML output.
TABLE FILE CAR
SUM DCOST
COMPUTE ODD/I1 = IF LAST ODD EQ 1 THEN 0 ELSE 1; NOPRINT
BY COUNTRY
ON TABLE SET HTMLCSS OFF
ON TABLE SET CSSURL 'car.css'
ON TABLE SET PAGE OFF
ON TABLE SET STYLE *
GRID=OFF, BORDER=OFF, SQUEEZE=OFF,$
TYPE=DATA, COLUMN=DCOST, CLASS=odd, WHEN=ODD EQ 1,$
TYPE=DATA, COLUMN=DCOST, CLASS=even, WHEN=ODD EQ 0,$
ENDSTYLE
END
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
October 10, 2012, 11:10 AM
Bethanne
I think this will work for you
DEFINE FILE CAR CAR1/A16=IF CAR EQ 'JENSEN' OR 'TRIUMPH' THEN ' ' ELSE CAR; CAR2/A16=IF CAR NE 'JENSEN' OR 'TRIUMPH' THEN ' ' ELSE CAR; END TABLE FILE CAR SUM SALES BY COUNTRY NOPRINT BY CAR NOPRINT BY CAR1 AS 'CAR' BY CAR2 AS '' ON TABLE SET PAGE-NUM OFF ON TABLE SET PAGE NOLEAD ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT PDF ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * UNITS=IN, PAGESIZE='Letter', LEFTMARGIN=0.20000, TOPMARGIN=0.200000, RIGHTMARGIN=0.20, BOTTOMMARGIN=0.20, LEFTGAP=0.0, RIGHTGAP=0.07, BOTTOMGAP=0.05, SQUEEZE=ON, ORIENTATION=LANDSCAPE, $ TYPE=REPORT, GRID=OFF, FONT='COURIER NEW', SIZE=9, $ TYPE=REPORT, COLUMN=P2, POSITION = .2,
$ TYPE=DATA, COLUMN=P1, FOCEXEC=car2( \ CAR=N1 \ ), WHEN = CAR1 NE ' ', $ TYPE=DATA, COLUMN=P2, FOCEXEC=car2( \ CAR=N1 \ ), WHEN = CAR2 NE ' ', $ ENDSTYLE END -RUN
October 10, 2012, 11:37 PM
JC Zhu
Thanks for all the useful suggestions. Bethanne's idea works, but my actual report is quite wide, and I need to save some space from creating a new column. Doug's subhead idea also works, but my actual report has an ACROSS column, and I can't get the subhead to work with that and display data for each across value. In the end, I am going with Wep5622's idea of using CSS. I never worked with CSS in WebFocus before, so this is a great way for me to get started. I did have to change one thing: I couldn't get "margin-left" to work, so I changed it to "padding-left".