Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Dynamic column visibility
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] Dynamic column visibility
 Login/Join
 
Member
posted
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
 
Posts: 21 | Registered: August 26, 2009Reply With QuoteReport This Post
Platinum Member
posted Hide Post
I thought it would be
CAR AS 'Column Title' &noprint
 
Posts: 142 | Location: Adelaide South Australia | Registered: October 27, 2006Reply With QuoteReport This Post
Gold member
posted Hide Post
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.
 
Posts: 77 | Registered: December 29, 2009Reply With QuoteReport This Post
Virtuoso
posted Hide Post
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
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Reply With QuoteReport This Post
Member
posted Hide Post
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
 
Posts: 21 | Registered: August 26, 2009Reply With QuoteReport This Post
Gold member
posted Hide Post
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.
 
Posts: 77 | Registered: December 29, 2009Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Dynamic column visibility

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.