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] need help in coding of WF 8

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] need help in coding of WF 8
 Login/Join
 
Gold member
posted
hello,
I am new in Development. My codes run in following way:
DEFAULT &ST_PROV_AB = 'ALL';
Table
IF &ST_PROV_AB EQ 'ALL' THEN GOTOLBL_USTOTALRPT;
-LBL_USTOTALRPT;
SUM
BY
HEADING
WHERE
STYLE
ENDSTYLE
-IF &ST_PROV_AB NE 'ALL' THEN GOTO BL_USBYSTATE;
-LBL_USBYSTATE
SUM
BY
HEADING
WHERE
STYLE
ENDSTYLE
END
WHEN I SELECT all it should give a particular kind of report and when ALL is not selected it should give me individual state report. It is done in Text Editor only. Please advice
PA

This message has been edited. Last edited by: Kathleen Butler,


WebFOCUS 8
Windows 7
HTML
 
Posts: 50 | Registered: August 18, 2015Report This Post
Virtuoso
posted Hide Post
Try to reproduce your need with the CAR file and you'll find the answer yourself, trust me, you will... Music

And you'll be proud to have it found yourself Smiler


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Virtuoso
posted Hide Post
Based on what you describe here's an example to follow:

TABLE FILE CAR
-IF &TEST EQ 'ALL' THEN GOTO JUMP;
SUM RCOST DCOST
BY COUNTRY
WHERE COUNTRY EQ 'ENGLAND' OR 'FRANCE';
HEADING
"THIS IS REPORT 1"
-GOTO SKIP;
-JUMP;
SUM SALES 
BY CAR
HEADING
"THIS IS REPORT 2"
WHERE RCOST LT 2000;
-SKIP;
END




You have to skip over the second part of your report which is what I think is missing in your pseudocode.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Gold member
posted Hide Post
Thanks a lot! Let me explain little detailed.I followed the code and get some good results. but still error.
I have to create two report:
Default @STATE = 'All' , it should give a summary report of State Total
Default@ STATE = ' CA' , or any state. It should give individual state report
My code:
TABLE FILE ABC
IF @ STATE EQ 'ALL' THEN GO TO JUMP;
SUM
BY COV TYPE
WHERE COV
WHERE DATE
HEADING
STYLING( DRILL DOWN)
ENDSTYLE
-GOTO SKIP;
-JUMP;
SUM
BY STATE NOPRINT
BY COV TYPE
WHERE COV
WHERE DATE
WHERE STATE
HEADING
STYLING(DRILL DOWN DIFFERENT COLUMN AS WE ARE SKIPPING ONE BY)
ENDSTYLE
-SKIP;
END


WebFOCUS 8
Windows 7
HTML
 
Posts: 50 | Registered: August 18, 2015Report This Post
Virtuoso
posted Hide Post
The first IF has to start with - and GOTO is one word so it should read:
-IF &STATE EQ 'ALL' THEN GOTO JUMP;


There's a difference between IF as a selection criteria and -IF which allows you to GOTO some label.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Virtuoso
posted Hide Post
Let's simpler:
-IF &STATE EQ 'ALL' THEN GOTO SUMRPT ELSE GOTO DETRPT;

-SUMRPT
TABLE FILE CAR
SUM RETAIL_COST
BY COUNTRY
END
-RUN
-GOTO XEND;

-DETRPT
TABLE FILE CAR
SUM RETAIL_COST
BY COUNTRY
BY CAR
BY MODEL
END
-RUN
-XEND


Build two reports and call the one you need.
And it's not the only way, there are several one such as having DM between the code, calling different fex, ...


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Virtuoso
posted Hide Post
I'm with MartinY on this one. You're building a lot of complexity into this code by doing it this way. Maintaining two reports and running the one you want is the right way to do it.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Gold member
posted Hide Post
I agree1 Thanks a lot ! I did in this way and it is working in Fex. Thanks a lot! Good One


WebFOCUS 8
Windows 7
HTML
 
Posts: 50 | Registered: August 18, 2015Report This Post
Guru
posted Hide Post
Hail skilled coders!


WebFOCUS 8.1.05 / APP Studio
 
Posts: 272 | Location: Brazil | Registered: October 31, 2006Report This Post
Gold member
posted Hide Post
Thank you for the feedback we identified the setting that was causing the issue.

Its in the excel trust center
Protected Views
the enable protected view for files located in potentially unsafe locations needs to be unchecked.


WebFOCUS 7.7 and WebFOCUS 8
Windows, All Outputs
 
Posts: 36 | Registered: August 17, 2010Report This Post
Virtuoso
posted Hide Post
Lynsi, you've replied on the wrong post Smiler

S/B : Report Opens in Excel - Ability to edit spreadsheet is disabled


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Gold member
posted Hide Post
hello,
Basing on this code I did and my fex is working well give two reports when called. If I give individual states it gives me a report( &STATE = 'CA' and if I give &STATE = 'ALL'IT GIVES ME A summary REPORT OF TOOTALS. however I AM FINDING ONE issues in HTML. I have two control , one is States and another is Date. When I select individual states like CA,NJ,NY... and dates it gives me individual states report. In the States control I also selected display 'ALL' values in setting. When I select 'ALL' it gives me report of all states values. That means the Second report is not picking up. This is my statements
-IF &ST_PROV_AB EQ 'ALL' THEN GOTO LBL_USTOTALRPT ELSE GOTO LBL_STATE;

Please suggest.
Regards,
PN


WebFOCUS 8
Windows 7
HTML
 
Posts: 50 | Registered: August 18, 2015Report This Post
Master
posted Hide Post
Did you create an HTML page with controls on it? If you did you can see what is being passed by adding these two lines at the top of your fex file:

-? &
-EXIT

If you are not using an HTML page with controls, then make sure 'ALL' is uppercase. In an earlier post, you had lowercase:

Default @STATE = 'All' , it should give a summary report of State Total
Default@ STATE = ' CA' , or any state. It should give individual state report


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Virtuoso
posted Hide Post
If you've built your control within an HTML page using HTML composer or AppStudio, the 'Add ALL Option' doesn't pass 'ALL' to your fex but by default it's: _FOC_NULL.

So, your -IF &ST_PROV_AB EQ 'ALL' ... will not be true since &STATES will be equal to _FOC_NULL.

Normally, using the 'ALL' option is to "ignore something/a line", this is the action 'executed' by FOCUS when it found, on execution, something such as :
TABLE FILE BLABLA
PRINT *
WHERE BLABLABLA EQ _FOC_NULL;
END

The WHERE is ignore so it's like having a print everything.

But all this is basic FOCUS training, maybe you need some if you don't already ?


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Gold member
posted Hide Post
quote:
Originally posted by Squatch:
Did you create an HTML page with controls on it? If you did you can see what is being passed by adding these two lines at the top of your fex file:

-? &
-EXIT

If you are not using an HTML page with controls, then make sure 'ALL' is uppercase. In an earlier post, you had lowercase:

Default @STATE = 'All' , it should give a summary report of State Total
Default@ STATE = ' CA' , or any state. It should give individual state report


Dear Squatch,
Thanks a lot! I have created three control in HTML. one is for Report selection(WFFMT). SECOND ONE IS DATE AND THIRD ONE IS STATE(The data is populated from &ST_PROV_AB column.
-IF &ST_PROV_AB EQ 'ALL' THEN GOTO LBL_USTOTALRPT ELSE GOTO LBL_STATE; In the state control when I select single state it is working fine. I am thinking what to do for ALL option of states and it should give a summary report. In the control of state if I add ALL option from setting it is giving FOC_NUll value which is true according to Martin.sO, DO I have to create a separate control for ALL STATE? AND IF I HAVE TO WRITE FEW FEX code where to write it? Thanks.


WebFOCUS 8
Windows 7
HTML
 
Posts: 50 | Registered: August 18, 2015Report This Post
Expert
posted Hide Post
As already explained, the "FOC_NULL" value will make WF ignore the WHERE statement, which means you will get all states. You don't have to do anything special in the fex. Have you read the manual regarding "FOC_NULL"? Have you tried running the HTML page, selecting ALL and seeing what is passed to the fex?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Gold member
posted Hide Post
THANK YOU! I really appreciate your advice and learning codes too but I said very new to development. I have also few trainings from IBI already. Currently cannot do but later yes. All my expectation is working fine in Fex. single state and ALL SUMMSRY States. The problem comes with HTML. In the control of States I want to show LBL_USTOTALRPT (SUMMARY) WHEN I GO 'ALL' option of control of states(HTML). here is my fex. May be I am missing something.
-DEFAULT &ISO_CAL_Y_MO_AB ='_FOC_NULL';
-DEFAULT &CV_DSPLY_NA ='_FOC_NULL';
-*-DEFAULT &ST_PROV_AB = 'ALL';(commented when do HTML)

-DEFAULT &WFFMT = 'HTML';

-IF &ST_PROV_AB EQ 'ALL' THEN GOTO LBL_USTOTALRPT ELSE GOTO LBL_STATE;

-LBL_USTOTALRPT
TABLE FILE PVT
PRINT
ISO.. NOPRINT AS 'SNAPSHOT'
NEW_M AS 'NO OF CVG'
NEW .. AS 'PREMIUM'

ST_PROV_AB NOPRINT AS 'STATE'
BY CV_DSPLY_NA AS 'COVERAGE TYPE'
WHERE &ST_PROV_AB = '_FOC_NULL';
END
TABLE FILE PVTF...
SUM
ISO NOPRINT AS 'SNAPSHOT'
NEW_AS 'NO OF CVG'
NEW_ AS 'PREMIUM'

ST_PROV_AB NOPRINT AS 'STATE'
BY CV_ AS 'COVERAGE TYPE'
HEADING
WHERE WHERE ( CV_DSPLY_NA EQ &CV_DSPLY_NA.(OR()).CV_DSPLY_NA. );
WHERE ( ISO_CAL_Y_MO_AB EQ &ISO_CAL_Y_MO_AB.(OR()).ISO_CAL_Y_MO_AB.QUOTEDSTRING);
ON TABLE SET STYLE...
ENDSTYLE
END


WebFOCUS 8
Windows 7
HTML
 
Posts: 50 | Registered: August 18, 2015Report This Post
Master
posted Hide Post
quote:
-IF &ST_PROV_AB EQ 'ALL' THEN GOTO LBL_USTOTALRPT ELSE GOTO LBL_STATE;

You probably need something like this:

-IF &ST_PROV_AB EQ '_FOC_NULL' THEN GOTO LBL_USTOTALRPT ELSE GOTO LBL_STATE;


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Gold member
posted Hide Post
I DID IT BUT IT SHOWS NOT THE SUMMARY ONE.I WANT TO CALL LBL_USTOTALRPT. IT IS SHOWING DETAIL REPORT WITH NO STYLING.


WebFOCUS 8
Windows 7
HTML
 
Posts: 50 | Registered: August 18, 2015Report This Post
Expert
posted Hide Post
The first problem is that you're not posting all your code - I don't have a clue what label LBL_STATE is because I don't see it in your code.

When you post code, please use the code button:


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
-*-DEFAULT &COUNTRY = 'FOC_NULL';
-DEFAULT &COUNTRY = 'ENGLAND';

-IF &COUNTRY EQ 'FOC_NULL' GOTO LBL_USTOTALRPT ELSE GOTO LBL_USBYSTATE;

-LBL_USTOTALRPT 

TABLE FILE CAR
SUM SALES
BY COUNTRY
HEADING
"SUMMARY REPORT"
END
-RUN

-GOTO LBL_END

-LBL_USBYSTATE

TABLE FILE CAR
SUM SALES
BY CAR
WHERE COUNTRY EQ '&COUNTRY'
HEADING
"REPORT FOR COUNTRY: <COUNTRY"
END
-RUN

-LBL_END

Switch between the two -DEFAULT statements to see the difference. Then try this with a parameter screen passing the value.

Good luck.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Gold member
posted Hide Post
Thank you so much! I tried and it worked. YAHOOOO....
Razzer


WebFOCUS 8
Windows 7
HTML
 
Posts: 50 | Registered: August 18, 2015Report This Post
Expert
posted Hide Post
It took much too long to get to this point.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Gold member
posted Hide Post
quote:
Originally posted by Francis Mariani:
It took much too long to get to this point.

I know so what do you suggest?


WebFOCUS 8
Windows 7
HTML
 
Posts: 50 | Registered: August 18, 2015Report This Post
Expert
posted Hide Post
Take some training.

Read the manual.

Be very precise in your posts.

Use an IBI supplied table to create "reproduce-able" code that any FocalPointer can run and modify. The CAR file is the easiest for this purpose, though it does not have date fields..


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Master
posted Hide Post
Best thread ever... Smiler


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Gold member
posted Hide Post
Thanks. which manuals you are suggesting? And I have no idea about IBI supplied table to create reproduce-able. Is there any video how to approach that?
Regards,
Niha


WebFOCUS 8
Windows 7
HTML
 
Posts: 50 | Registered: August 18, 2015Report This Post
Virtuoso
posted Hide Post
If you don't know about IBI sample tables you're starting from far away (no offense) Eeker

Contact your IBI rep, it's the better starting point


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report 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] need help in coding of WF 8

Copyright © 1996-2020 Information Builders