Focal Point
Centering Multi level ACROSS in PDF

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

May 04, 2005, 03:51 PM
reFOCUSing
Centering Multi level ACROSS in PDF
I have a report that has two ACROSS fields the first field I'm trying to center over all the value of the second ACROSS field. In HTML and ELX2K this will work but PDF it will not.

Think is maybe a known issue (found this old post). Does anybody have a work-around? I'm running WF 5.3.2.

Here is some sample code:

TABLE FILE CAR
SUM RETAIL_COST
BY HIGHEST COUNTRY
ACROSS CAR AS ' '
ACROSS HIGHEST SEATS AS ' '
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
-*ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET STYLE *
TYPE=ACROSSVALUE,ACROSS=1,BORDER=LIGHT,JUSTIFY=CENTER,$
TYPE=ACROSSVALUE,ACROSS=2,BORDER=LIGHT,JUSTIFY=RIGHT,$
ENDSTYLE
END
May 04, 2005, 06:51 PM
k.lane
Curtis, unfortunately I don't have the CAR file at my disposal. However, using the time dimension master I have 'creatively' come up with a way to do what you seek since I know of no way to do through the stylesheet as you have outlined. I figured, why not try it out, since I'm just sitting here at lunch.

SET WEBVIEWER = OFF
SET ASNAMES = ON

TABLE FILE TIME_DIMENSION
SUM CNT.REPORT_MONTH AS 'RPT_CNT'
COMPUTE MID_POINT/I6 = (C1 / 2) + 0.5 ;
BY REPORT_YEAR
BY REPORT_QUARTER
SUM MONTH_TOTAL_DAYS
BY REPORT_YEAR
BY REPORT_QUARTER
RANKED BY REPORT_MONTH
WHERE REPORT_YEAR EQ 2002 OR 2003 OR 2004
ON TABLE HOLD AS TEST
END

DEFINE FILE TEST
NEW_ACROSS/I6 MISSING ON = IF MID_POINT EQ RANK THEN REPORT_QUARTER ELSE MISSING ;
END

SET NODATA = ' '

TABLE FILE TEST
SUM MONTH_TOTAL_DAYS
BY REPORT_YEAR
ACROSS REPORT_QUARTER NOPRINT
ACROSS REPORT_MONTH NOPRINT
ACROSS NEW_ACROSS AS ''
ACROSS REPORT_MONTH AS ''
WHERE REPORT_QUARTER EQ 1 OR 2
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, $
TYPE=ACROSSVALUE,ACROSS=3,JUSTIFY=CENTER,$
TYPE=ACROSSVALUE,ACROSS=4,JUSTIFY=CENTER,$
-*TYPE=ACROSSVALUE,ACROSS=3,BORDER=LIGHT,JUSTIFY=CENTER,$
-*TYPE=ACROSSVALUE,ACROSS=4,BORDER=LIGHT,JUSTIFY=CENTER,$
ENDSTYLE
END

This works well if there are an odd number of rows for the lower level across. If even, then you might be out of luck unless someone out there knows of a stylesheet way to do this.

The jist of the method is to identify the 'mid point' element in the lower level sort by counting the total number in the lower level, dividing by two and adjusting by 0.5. For a count of 5, this would equate to 3 (or the third value). For a value of 3, it would equate to 2 (or the second value).

Only in cases where the rank was equal to the midpoint, do you populate the new column (NEW_ACROSS). Everything else is missing and NODATA is set to ' ' .

I know, it's a little off the wall, but this method can work if you cannot find any other solution to your problem.

Ken