Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] dynamic columns

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] dynamic columns
 Login/Join
 
Member
posted
Hi!!

I wanna do the following and I do a lot of tries but it has been impossible:

Example:

I have the next code:

TABLE FILE SQLOUT
NAME
COMPUTE PAG/P20CS = PAGE; NOPRINT
COMPUTE VIS1/A7 = IF (IMOD(PAG,2,'I2') NE 0) THEN ' ' ELSE 'NOPRINT'; NOPRINT
COMPUTE VIS2/A7 = IF (IMOD(PAG,2,'I2') EQ 0) THEN ' ' ELSE 'NOPRINT'; NOPRINT
IMP1 AS ‘Value1’
IMP2 AS ‘Value2’
ON TABLE PCHOLD FORMAT PDF


END

What I want to do is to print NAME in both pages, IMP1 in odd pages and IMP2 in even pages. That is:

Page 1:
NAME IMP1
Xxxxx 25
Aaaaaa 56

Page 2:
NAME IMP2
Xxxxx 57
Aaaaaa 89

PAGE gives me the page number.
The field VIS1 or VIS2 gives me the information whether I need to print or not. But if I put IMP1 AS ‘Value1’ VIS1, logically VIS1 appears like another field because it isn’t a variable.

I have also tried to define the variable VIS1 in the DEFINE but the field PAGE takes always the first value, that is, the value 1 and I don’t want that because PAGE has different values. Like that:

DEFINE SQLOUT
PAG/P20CS = PAGE; NOPRINT
-SET &VIS1 = IF (IMOD(PAG,2,'I2') NE 0) THEN ' ' ELSE 'NOPRINT';
END

Any ideas?

Thank you!!!

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


WebFocus 7.6.4 - Oracle 9
 
Posts: 4 | Registered: December 18, 2007Report This Post
Expert
posted Hide Post
I'm not sure what you are trying to do. Is this example even close?
TABLE FILE CAR
PRINT SALES
COMPUTE PAG/P2CS = TABPAGENO; 
COMPUTE VIS/A7 = IF (IMOD(PAG,2,'I2') NE 0) THEN 'IMP1 ' ELSE 'IMP2'; BY COUNTRY PAGE-BREAK
BY CAR 
BY MODEL
BY BODYTYPE
ON TABLE SET ONLINE-FMT PDF
ON TABLE SET STYLE *
ORIENTATION=LANDSCAPE,$
ENDSTYLE
END


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
<JG>
posted
Your approach is wrong, you cannot conditionally suppress a column with NOPRINT
Because NOPRINT can not be dynamic.

Make your data and heading dynamic and display your headings in a subhead



 
TABLE FILE CAR
PRINT 
     MODEL AS ''
     COMPUTE PAG/P2CS = TABPAGENO; NOPRINT
     COMPUTE VIS_DATA/A50 = IF ( IMOD(PAG, 2, 'I2') NE 0 ) THEN MODEL ELSE BODYTYPE;
 AS ''
     COMPUTE VIS_HEAD/A50 = IF ( IMOD(PAG, 2, 'I2') NE 0 ) THEN 'MODEL' ELSE 'BODYTYPE'; NOPRINT
 AS ''
BY CAR AS ''
     
ON CAR SUBHEAD
"CAR <+0> MODEL <VIS_HEAD"
ON CAR PAGE-BREAK
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=LANDSCAPE,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='TIMES NEW ROMAN',
     SIZE=10,
$
TYPE=SUBHEAD,
     BY=1,
     LINE=1,
     OBJECT=TEXT,
     ITEM=1,
     JUSTIFY=LEFT,
     WIDTH=1.08,
$
TYPE=SUBHEAD,
     BY=1,
     LINE=1,
     OBJECT=TEXT,
     ITEM=2,
     JUSTIFY=LEFT,
     WIDTH=2.10,
$
TYPE=SUBHEAD,
     BY=1,
     LINE=1,
     OBJECT=FIELD,
     ITEM=1,
     JUSTIFY=LEFT,
     WIDTH=3.625,
$
ENDSTYLE
END

 
 
Report This Post
Expert
posted Hide Post
I beleive you could do this with a coordinated compound report.

You would have two reports fitting the two layout requirements and turn coordination (MERGE) on


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!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Member
posted Hide Post
Thank you JG!!!

I have done as you said and it works perfectly!!


WebFocus 7.6.4 - Oracle 9
 
Posts: 4 | Registered: December 18, 2007Report This Post
Guru
posted Hide Post
Have i misunderstood? as i can make noprint dynamic..

 
-SET &CHOICE = 'N';
-SET &NOP = IF &CHOICE EQ 'Y' THEN 'NOPRINT' ELSE '';

TABLE FILE CAR 
PRINT CAR MODEL BODYTYPE 
BY COUNTRY '&NOP'
END
 


test by changing the value &CHOICE to 'Y' or 'N' and compare results...


Developer Studio 7.64
Win XP
Output: mostly HTML, also Excel and PDF

"Never attribute to malice that which can be adequately explained by stupidity." - Heinlein's Razor
 
Posts: 285 | Location: UK | Registered: October 26, 2007Report This Post
Guru
posted Hide Post
ah i see DM is done before the TABLE Request so yes i see what you mean. The &Var can't be set until the table data has been processed...


Developer Studio 7.64
Win XP
Output: mostly HTML, also Excel and PDF

"Never attribute to malice that which can be adequately explained by stupidity." - Heinlein's Razor
 
Posts: 285 | Location: UK | Registered: October 26, 2007Report This Post
Virtuoso
posted Hide Post
That is correct. Anything with the '-' (all Dialogue Manager commands) is executed in the order encountered and before any FOCUS code is run. That is the reason that you can't mix the two (i.e. -SET a variable equal to a field value.)


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, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] dynamic columns

Copyright © 1996-2020 Information Builders