Focal Point
[CLOSED] Hide Empty columns with PAGE-BREAK

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

September 29, 2011, 08:29 AM
atturhari
[CLOSED] Hide Empty columns with PAGE-BREAK
Hi,

Run the below code,

DEFINE FILE CAR
TEST/I1 MISSING ON = IF COUNTRY EQ 'ENGLAND' THEN 1 ELSE MISSING;
END
TABLE FILE CAR
SUM
SALES
TEST
BY COUNTRY PAGE-BREAK
END


Can the Empty column(TEST) be hidden when the column(TEST) has no data?
In the output, i want the column "TEST" to appear only for ENGLAND and not appear in other pages. The output format is PDF.

Thankyou

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


WF 7.7.02 on Windows 7
Teradata
HTML,PDF,EXCEL,AHTML
September 29, 2011, 12:01 PM
njsden
You either print or NOPRINT a whole column, but not choose which one depending on a particular record.

You may need to break your request in 2, HOLDing 2 sets of results: with those with a value and those without it. Then you can run 2 reports out of each HOLD (one would include the column, the other wouldn't) and use the compound layout to put them together.

Unless there is some magic in 7.7 that would allow something to happen but it doesn't make sense to me.

Suppose you were not doing a PAGE-BREAK, what would the information flow in your page if you hid a columns for some records and not for others? alignment would be nuts as everything would shift to the left for each record where a column disappears!



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.
September 29, 2011, 12:30 PM
Dan Satchell
Here's an old trick that might work, depending on your requirements:

DEFINE FILE CAR
 TEST/I1 MISSING ON = IF COUNTRY EQ 'ENGLAND' OR 'ITALY' THEN 1 ELSE MISSING;
END
-*
TABLE FILE CAR
 SUM
  SALES
  TEST
 BY COUNTRY PAGE-BREAK
 ON TABLE SET STYLE *
  TYPE=REPORT, COLUMN=TEST, COLOR=WHITE, WHEN=TEST EQ 0, $
 ENDSTYLE
 ON TABLE PCHOLD FORMAT PDF
END



WebFOCUS 7.7.05
September 29, 2011, 05:48 PM
Waz
You could also control the column titles your self.

DEFINE FILE CAR
TEST/I1 MISSING ON = IF COUNTRY EQ 'ENGLAND' THEN 1 ELSE MISSING;
HEADTEST/A4 = IF COUNTRY EQ 'ENGLAND' THEN 'TEST' ELSE ' ';
END
TABLE FILE CAR
HEADING
"COUNTRY<+0>SALES<+0><HEADTEST"
SUM
SALES    AS ''
TEST     AS ''
BY COUNTRY PAGE-BREAK   AS ''
ON TABLE SET STYLE *
TYPE=HEADING, HEADALIGN=BODY, $
ENDSTYLE
END



Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

September 29, 2011, 06:26 PM
Doug
Two more thoughts:

1) Add SET NODATA = ''
2) Keep in mind that the text can still be seen when the ol' "color=white" trick is used.
September 29, 2011, 07:05 PM
N.Selph
What about the new set command:
SET HIDENULLACRS=ON
it is supposed to suppress the column on the sort groups where it is all null. I haven't had a change to try it yet. Is it just for 7.7.03?


(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
September 30, 2011, 05:27 AM
atturhari
Thanks everyone.

The "COLOR=WHITE" cannot be used in the report, as the numbers of columns displayed is dynamic based on the user's selection. The last 3 columns in my report are static showing the Row totals.

Selph,
SET HIDENULLACRS=ON works well for the ACROSS report. However, i need to display some columns with really long titles after the ACROSS columns. Since the across values and the normal column titles do NOT appear horziontally on a single line, i converted ACROSS into columns and displayind them.

The HIDENULLACRS=ON will do the job if the report does not have any other columns to be displayed after the Across columns.

I think i will have to wait for HIDENULL=ON


WF 7.7.02 on Windows 7
Teradata
HTML,PDF,EXCEL,AHTML
September 30, 2011, 09:46 AM
George Patton
SET HIDENULLACRS=ON

works great - but only with ACROSS not with BY fields.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP