Focal Point
[CLOSED] Dynamic column visibility

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

November 16, 2010, 10:42 PM
redapple
[CLOSED] Dynamic column visibility
I have a need to make some columns on a report dynamically visible/invisible.

I have found posts indicating the use an amper variable to accomplish my goal.

Something like CAR &noprint, where &noprint is set to 'NOPRINT' or ' '.

Is there away to include a custom column title on such a field that will not confuse the GUI.

I have found CAR &noprint 'Column Title' confuses the GUI into showing 2 fields.

The report still runs as intended, I'm just afraid another developer might come along in the future open the GUI and become confused.

Thanks.

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


WebFOCUS 7.6.11
Developer Studio on Windows XP. Server Components running on Windows Server 2003.
Excel, HTML, PDF
November 17, 2010, 04:16 AM
OPALTOSH
I thought it would be
CAR AS 'Column Title' &noprint
November 22, 2010, 12:49 AM
Joe Beydoun
I'm not sure if you're using a launch page on this report, but i found the best way to do this is with double-list boxes using the code below, this also allows users to select the sort order of the columns:

-SET &ECHO = ALL;
-DEFAULT &WFFMT = 'HTML'
-DEFAULT &SUMPRNT = 'SUM'
-DEFAULT &VERBLIST = '''DEALER_COST'' NONE ''RETAIL_COST'' NONE ''SALES'''
-DEFAULT &SORTLIST = '''COUNTRY'' NONE ''CAR'' NONE ''BODYTYPE'''
-SET &VERB = IF &SUMPRNT EQ 'PRINT' THEN 'PRINT' ELSE 'SUM';
-SET &VERBOBJ1 = STRREP(&VERBLIST.LENGTH, &VERBLIST, 1, '''', 0, 'x', &VERBLIST.LENGTH, A&VERBLIST.LENGTH);
-SET &VERBOBJ = STRREP(&VERBOBJ1.LENGTH, &VERBOBJ1, 5,' NONE', 0, 'x', &VERBOBJ1.LENGTH, A&VERBOBJ1.LENGTH);
-SET &SORTOBJ1 = STRREP(&SORTLIST.LENGTH, &SORTLIST, 1, '''', 0, 'x', &SORTLIST.LENGTH, A&SORTLIST.LENGTH);
-SET &SORTOBJ = 'BY ' | STRREP(&SORTOBJ1.LENGTH, &SORTOBJ1, 4 , 'NONE', 2, 'BY', &SORTOBJ1.LENGTH, A&SORTOBJ1.LENGTH);

TABLE FILE CAR
&VERB
&VERBOBJ
&SORTOBJ
ON TABLE PCHOLD FORMAT &WFFMT
END

**P.S. instead of the word NONE, your code might generate an OR which is what it's supposed to, i have an open case with support for this.


version 8202M
Reporting Server on
Windows Server using DB2 Connect to access data from iseries.
November 22, 2010, 01:24 PM
Darin Lee
One little trick I've employed is to intentionally misuse FOC_NONE in cases like this. FOC_NONE is usually used when parameters are populated and a specific value needs to be set to 'ALL' - in essence removing the filter completely. So the parameter value is set to FOC_NONE. WebFOCUS is trained to ignore EVERYTHING on a line of code that contains FOC_NONE. So I sometimes use FOC_NONE as an amper variable value when I want to dynamically exclude an ENTIRE line of code. Try setting the value of &noprint to 'FOC_NONE' and see if that solves your problem.
On a related note, the syntax shown by OPALTOSH would be correct. CAR &noprint 'Column Title' would probably give you a syntax error.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
November 30, 2010, 09:38 AM
redapple
Thanks opaltosh, Joe, and Darin.

I'm continuing to use the &noprint method, placed in the correct position. But still seeing the extra fields in Report Painter.

It's something I can live with.

Thanks all
-redapple.


WebFOCUS 7.6.11
Developer Studio on Windows XP. Server Components running on Windows Server 2003.
Excel, HTML, PDF
December 03, 2010, 06:27 PM
Joe Beydoun
On my box, if i use a no print and Active reports and do an export to excel from Active report, those columns show up.

Not sure if that's considered a bug, but with the columns i'm hiding being sensitive, i am a bit careful with NOPRINT.


version 8202M
Reporting Server on
Windows Server using DB2 Connect to access data from iseries.