Focal Point
[CLOSED] Suppress blank columns from Excel output within ACROSS fields

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

January 25, 2019, 02:52 PM
JJ
[CLOSED] Suppress blank columns from Excel output within ACROSS fields
Can someone help me to suppress the blank columns(Column D and E in Excel)? Both show up due to ACROSS and ACROSS-TOTAL fields. First ACROSS column doesn't have any blanks but second one(#Sedan) has one(Column E) and the third one (#Coupe) has two(Col D & E). Due to this I can't center data within first ACROSS value. If someone can help me to merge those columns to show up as one cell, that will work too. Thank you! See the code below.

  
SET BYDISPLAY = ON
SET WEBVIEWER = ON
SET AREXPEXCEL = XLSX
SET ACROSSTITLE = SIDE
SET ACROSSPRT = NORMAL
SET ACROSSLINE = SKIP
SET HIDENULLACRS=ON
SET HOLDMISS = ON
SET NODATA=''

DEFINE FILE CAR
  CNTSEDAN/I5=IF BODYTYPE EQ 'SEDAN' THEN 1 ELSE 0;
  CNTCOUPE/I5=IF BODYTYPE EQ 'COUPE' THEN 1 ELSE 0;

END

TABLE FILE CAR
SUM
BODYTYPE AS ' '
BY  COUNTRY AS 'Country'
BY  CAR AS 'Car'

ACROSS  MODEL AS ' '
ACROSS CNTSEDAN AS '# Sedan' ACROSS-TOTAL AS ' '
ACROSS CNTCOUPE AS '# Coupe' ACROSS-TOTAL AS ' '
WHERE BODYTYPE EQ 'SEDAN' OR 'COUPE';
ON TABLE SUBHEAD
"Test File"
" "
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE SET BYDISPLAY ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT XLSX
ON TABLE SET XLSXPAGESETS ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,
$
     PAGESIZE='Letter',
     LEFTMARGIN=0.000556,
     RIGHTMARGIN=0.000000,
     TOPMARGIN=0.500000,
     BOTTOMMARGIN=0.010000,
     ORIENTATION=LANDSCAPE,
     SUMMARY='Cert Status',
     TITLETEXT='Cert Status',
	 SQUEEZE=ON,
$
TYPE=REPORT,
     GRAPHCOLOR='GREEN',
     GRAPHCOLORNEG='RED',
$
TYPE=REPORT,
     FONT='ARIAL',
     SIZE=9,
     COLOR='BLACK',
     BACKCOLOR='NONE',
     STYLE=NORMAL,
     FREEZE-WIDTH=AUTO,
     LINES-PER-PAGE=30,
     CALC-LOCATION=BOTTOM,
$
TYPE=ACROSSVALUE, ACROSS=MODEL, WRAP=0.2, JUSTIFY=CENTER ,$
TYPE=ACROSSVALUE, ACROSS=CNTSEDAN, WRAP=0.2, JUSTIFY=CENTER ,$
TYPE=ACROSSVALUE, ACROSS=CNTCOUPE, WRAP=0.2, JUSTIFY=RIGHT ,$
TYPE=DATA,
     ACROSSCOLUMN=MODEL,
     JUSTIFY=CENTER,
	 WRAP=0.1,
$
TYPE=DATA,
     ACROSSCOLUMN=BODYTYPE,
     COLOR='WHITE',
     BACKCOLOR='RED',
     STYLE=BOLD,
     WHEN=BODYTYPE EQ 'EXPIRED',
	 JUSTIFY=CENTER,
$
TYPE=DATA,
     ACROSSCOLUMN=BODYTYPE,
     COLOR='WHITE',
     BACKCOLOR='GREEN',
     STYLE=BOLD,
     WHEN=BODYTYPE EQ 'Certified',
	 JUSTIFY=CENTER,
$
TYPE=DATA,
     ACROSSCOLUMN=BODYTYPE,
     ITEM=2,
	 JUSTIFY=LEFT,
	 WRAP=0.01,
$
TYPE=DATA,
     ACROSSCOLUMN=N12,
     JUSTIFY=CENTER,
$
TYPE=ACROSSTITLE,
     JUSTIFY=RIGHT,
	 SIZE=11,
     BACKCOLOR=RGB(99 184 255),
$
TYPE=ACROSSVALUE,
	JUSTIFY=CENTER,
	STYLE=BOLD,
	SIZE=10,
	BACKCOLOR=RGB(99 184 255),
$
TYPE=TITLE,
     STYLE=-UNDERLINE+BOLD,
$
TYPE=TITLE,
     BACKCOLOR='NAVY',
     JUSTIFY=CENTER,
$
TYPE=TITLE,
     COLUMN=N2,
     BACKCOLOR='NAVY',
     JUSTIFY=CENTER,
$
TYPE=TITLE,
     COLUMN=N3,
     BACKCOLOR='NAVY',
     JUSTIFY=CENTER,
$
TYPE=TITLE,
     COLUMN=N6,
     BACKCOLOR='NAVY',
     JUSTIFY=CENTER,
-*	 WRAP=0.2,
$
TYPE=TITLE,
     COLUMN=N11,
     BACKCOLOR='NAVY',
     JUSTIFY=LEFT,
$
TYPE=TITLE,
     COLUMN=N5,
     BACKCOLOR='NAVY',
     JUSTIFY=CENTER,
-*	 WRAP=0.2,
$
TYPE=TITLE,
     COLUMN=N4,
     BACKCOLOR='NAVY',
     JUSTIFY=CENTER,
$
TYPE=TITLE,
     COLUMN=N1,
     BACKCOLOR='NAVY',
     JUSTIFY=CENTER,
$
TYPE=ACROSSTITLE,
     COLUMN=MODEL,
     BACKCOLOR='NAVY',
     JUSTIFY=CENTER,
-*	 WRAP=0.5,
$
TYPE=ACROSSTITLE,
     COLUMN=CNTSEDAN,
     BACKCOLOR='NAVY',
     JUSTIFY=RIGHT,
-*	 WRAP=0.5,
$
TYPE=ACROSSTITLE,
     COLUMN=CNTCOUPE,
     BACKCOLOR='NAVY',
     JUSTIFY=RIGHT,
-*	 WRAP=0.5,
$
TYPE=TABHEADING,
     SIZE=12,
     STYLE=BOLD,
     JUSTIFY=LEFT,
$
TYPE=REPORT,
     OBJECT=MENU,
     COLOR=RGB(0 51 102),
     HOVER-COLOR='WHITE',
     BACKCOLOR=RGB(51 204 204),
     HOVER-BACKCOLOR='PURPLE',
     BORDER-COLOR='FUCHSIA',
$
TYPE=REPORT,
     OBJECT=STATUS-AREA,
     COLOR='WHITE',
     BACKCOLOR='GRAY',
$
TYPE=REPORT,
     OBJECT=CURRENT-ROW,
     HOVER-BACKCOLOR='GRAY',
     BACKCOLOR=RGB(255 153 0),
$
TYPE=REPORT,
     OBJECT=CALC-AREA,
     COLOR=RGB(153 51 0),
     BACKCOLOR=RGB(255 204 153),
$
ENDSTYLE
END



Thank you,

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8.1.05M
Windows 2003
Excel, HTML, PDF
January 28, 2019, 07:58 AM
MartinY
Be doing an ACROSS-TOTAL your are asking FOCUS to perform a total on the measure (SUM BODYTYPE) which is not possible since it's an alpha.
Reason why you have two blank columns : One for the ACROSS-TOTAL at CNTSEDAN and one for CNTCOUPE.

I think that what you are trying to perform is to have to total for CNTSEDAN and CNTCOUPE.
You need to be a little more creative if my assumption is the good one.
I let you play with the alignment.

SET BYDISPLAY = ON
SET WEBVIEWER = ON
SET AREXPEXCEL = XLSX
SET ACROSSTITLE = SIDE
SET ACROSSPRT = NORMAL
SET ACROSSLINE = SKIP
SET HIDENULLACRS=ON
SET HOLDMISS = ON
SET NODATA=''

DEFINE FILE CAR
CNTSEDAN/I5=IF BODYTYPE EQ 'SEDAN' THEN 1 ELSE 0;
CNTCOUPE/I5=IF BODYTYPE EQ 'COUPE' THEN 1 ELSE 0;
END
TABLE FILE CAR
SUM CNTSEDAN
    CNTCOUPE
BY COUNTRY
BY CAR
BY TOTAL COMPUTE MODELID  /I2  = 1;
BY MODEL
BY BODYTYPE
WHERE BODYTYPE EQ 'SEDAN' OR 'COUPE';
ON TABLE HOLD AS EXTDATA
END
-RUN

TABLE FILE EXTDATA
SUM CNTSEDAN
    CNTCOUPE
BY TOTAL COMPUTE COUNTRY  /A10 = '';
BY TOTAL COMPUTE CAR      /A16 = '';
BY TOTAL COMPUTE MODELID  /I2  = 99;
BY TOTAL COMPUTE MODEL    /A24 = 'Total';
BY TOTAL COMPUTE BODYTYPE /A12 = '';
ON TABLE HOLD AS TOTDATA
END
-RUN

TABLE FILE EXTDATA
SUM CNTSEDAN
    CNTCOUPE
BY COUNTRY
BY CAR
BY MODELID
BY MODEL
BY BODYTYPE
ON TABLE HOLD AS RPTDATA
MORE
FILE TOTDATA
END
-RUN

TABLE FILE RPTDATA
SUM BODYTYPE AS ' '
BY COUNTRY AS 'Country'
BY CAR AS 'Car'
ACROSS MODELID NOPRINT
ACROSS MODEL AS ' '
ACROSS CNTSEDAN AS '# Sedan'
ACROSS CNTCOUPE AS '# Coupe'
ON TABLE SUBHEAD
"Test File"
" "
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE SET BYDISPLAY ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT XLSX
ON TABLE SET XLSXPAGESETS ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE=IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/ENIADefault_combine.sty,
$
     PAGESIZE='Letter',
     LEFTMARGIN=0.000556,
     RIGHTMARGIN=0.000000,
     TOPMARGIN=0.500000,
     BOTTOMMARGIN=0.010000,
     ORIENTATION=LANDSCAPE,
     SUMMARY='Cert Status',
     TITLETEXT='Cert Status',
	 SQUEEZE=ON,
$
TYPE=REPORT,
     GRAPHCOLOR='GREEN',
     GRAPHCOLORNEG='RED',
$
TYPE=REPORT,
     FONT='ARIAL',
     SIZE=9,
     COLOR='BLACK',
     BACKCOLOR='NONE',
     STYLE=NORMAL,
     FREEZE-WIDTH=AUTO,
     LINES-PER-PAGE=30,
     CALC-LOCATION=BOTTOM,
$
TYPE=ACROSSVALUE, ACROSS=MODEL, WRAP=0.2, JUSTIFY=CENTER ,$
TYPE=ACROSSVALUE, ACROSS=CNTSEDAN, WRAP=0.2, JUSTIFY=CENTER ,$
TYPE=ACROSSVALUE, ACROSS=CNTCOUPE, WRAP=0.2, JUSTIFY=RIGHT ,$
TYPE=DATA,
     ACROSSCOLUMN=MODEL,
     JUSTIFY=CENTER,
	 WRAP=0.1,
$
TYPE=DATA,
     ACROSSCOLUMN=BODYTYPE,
     COLOR='WHITE',
     BACKCOLOR='RED',
     STYLE=BOLD,
     WHEN=BODYTYPE EQ 'EXPIRED',
	 JUSTIFY=CENTER,
$
TYPE=DATA,
     ACROSSCOLUMN=BODYTYPE,
     COLOR='WHITE',
     BACKCOLOR='GREEN',
     STYLE=BOLD,
     WHEN=BODYTYPE EQ 'Certified',
	 JUSTIFY=CENTER,
$
TYPE=DATA,
     ACROSSCOLUMN=BODYTYPE,
     ITEM=2,
	 JUSTIFY=LEFT,
	 WRAP=0.01,
$
TYPE=DATA,
     ACROSSCOLUMN=N12,
     JUSTIFY=CENTER,
$
TYPE=ACROSSTITLE,
     JUSTIFY=RIGHT,
	 SIZE=11,
     BACKCOLOR=RGB(99 184 255),
$
TYPE=ACROSSVALUE,
	JUSTIFY=CENTER,
	STYLE=BOLD,
	SIZE=10,
	BACKCOLOR=RGB(99 184 255),
$
TYPE=TITLE,
     STYLE=-UNDERLINE+BOLD,
$
TYPE=TITLE,
     BACKCOLOR='NAVY',
     JUSTIFY=CENTER,
$
TYPE=TITLE,
     COLUMN=N2,
     BACKCOLOR='NAVY',
     JUSTIFY=CENTER,
$
TYPE=TITLE,
     COLUMN=N3,
     BACKCOLOR='NAVY',
     JUSTIFY=CENTER,
$
TYPE=TITLE,
     COLUMN=N6,
     BACKCOLOR='NAVY',
     JUSTIFY=CENTER,
-*	 WRAP=0.2,
$
TYPE=TITLE,
     COLUMN=N11,
     BACKCOLOR='NAVY',
     JUSTIFY=LEFT,
$
TYPE=TITLE,
     COLUMN=N5,
     BACKCOLOR='NAVY',
     JUSTIFY=CENTER,
-*	 WRAP=0.2,
$
TYPE=TITLE,
     COLUMN=N4,
     BACKCOLOR='NAVY',
     JUSTIFY=CENTER,
$
TYPE=TITLE,
     COLUMN=N1,
     BACKCOLOR='NAVY',
     JUSTIFY=CENTER,
$
TYPE=ACROSSTITLE,
     COLUMN=MODEL,
     BACKCOLOR='NAVY',
     JUSTIFY=CENTER,
-*	 WRAP=0.5,
$
TYPE=ACROSSTITLE,
     COLUMN=CNTSEDAN,
     BACKCOLOR='NAVY',
     JUSTIFY=RIGHT,
-*	 WRAP=0.5,
$
TYPE=ACROSSTITLE,
     COLUMN=CNTCOUPE,
     BACKCOLOR='NAVY',
     JUSTIFY=RIGHT,
-*	 WRAP=0.5,
$
TYPE=TABHEADING,
     SIZE=12,
     STYLE=BOLD,
     JUSTIFY=LEFT,
$
TYPE=REPORT,
     OBJECT=MENU,
     COLOR=RGB(0 51 102),
     HOVER-COLOR='WHITE',
     BACKCOLOR=RGB(51 204 204),
     HOVER-BACKCOLOR='PURPLE',
     BORDER-COLOR='FUCHSIA',
$
TYPE=REPORT,
     OBJECT=STATUS-AREA,
     COLOR='WHITE',
     BACKCOLOR='GRAY',
$
TYPE=REPORT,
     OBJECT=CURRENT-ROW,
     HOVER-BACKCOLOR='GRAY',
     BACKCOLOR=RGB(255 153 0),
$
TYPE=REPORT,
     OBJECT=CALC-AREA,
     COLOR=RGB(153 51 0),
     BACKCOLOR=RGB(255 204 153),
$
ENDSTYLE
END
-RUN



WF versions : Prod 8.2.0.1M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007