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.
Hello I am writing a code for a fex in which i need to display an error msg if there is no data available in the report i have it pops up message when there is data as well :
TABLE FILE &MONTHNAME SUM WBS_COST BY HIGHEST YEAR_OF_CREATING BY HIGHEST MOUNT_OF_CREATION BY MONTHYEAR WHERE STATUS EQ 'Open' ; WHERE CR_CATEGORIE EQ 'Major' ; WHERE MONTHYEAR GE DATES ; WHERE MONTHYEAR LT '2017.03'; WHERE SUBMODULE EQ '&SUBMODULE' ; WHERE GROUP_COMPANY_ EQ '&GROUP_COMPANY' ; WHERE OPERATING_UNIT_ EQ '&OPERATING_UNIT' ; ON TABLE HOLD AS 'HOLDDIFF' FORMAT ALPHA END
-SET &MONTHDIFFCURRENT= &MONTHDIFFCURRENT - 1;
TABLE FILE HOLDDIFF SUM COMPUTE DIFF/D9.2 = LAST WBS_COST - WBS_COST; BY HIGHEST YEAR_OF_CREATING BY HIGHEST MOUNT_OF_CREATION ON TABLE HOLD AS 'HOLDDIFFCOMPUTE' FORMAT ALPHA END
-*--------------------------------------------------------Difference last two month Value-----------------------------------------------------------
TABLE FILE HOLDDIFFCOMPUTE PRINT DIFF WHERE YEAR_OF_CREATING EQ &YEARDIFFCURRENT; WHERE MOUNT_OF_CREATION EQ &MONTHDIFFCURRENT; ON TABLE HOLD AS 'DIFFRENCE' FORMAT ALPHA END -RUN -IF &LINES EQ 0 GOTO FOC_ERROR ;
-*----------------------------------------------------- Create a LAST VALUE ------------------------------------------------------------------------------
TABLE FILE HOLDDIFF PRINT WBS_COST -*COMPUTE COUNTER/D6 = 1 ; ON TABLE HOLD AS 'LASTVALUE' FORMAT ALPHA END -RUN -IF &LINES EQ 0 GOTO FOC_ERROR ;
-*-------------------------------------------------------Addition of forecasting-----------------------------------------------------------------------------
TABLE FILE HOLDDIFF PRINT MONTHYEAR WBS_COST YEAR_OF_CREATING MOUNT_OF_CREATION COMPUTE COUNTER/D6 = 1 ; BY YEAR_OF_CREATING NOPRINT BY MOUNT_OF_CREATION NOPRINT ON TABLE HOLD AS 'ORIGINAL' FORMAT ALPHA END
TABLE FILE HOLDDIFF PRINT MONTHYEAR WBS_COST YEAR_OF_CREATING MOUNT_OF_CREATION COMPUTE COUNTER/D6 = 2 ; BY YEAR_OF_CREATING NOPRINT BY MOUNT_OF_CREATION NOPRINT ON TABLE HOLD AS 'DUPLICATE' FORMAT ALPHA END
-*------------------------------------------------------------------APPEND ORIGINAL & DUPLICATE USING MORE------------------------------------------------------
TABLE FILE ORIGINAL PRINT * ON TABLE HOLD AS MOREOUT MORE FILE DUPLICATE END
-*-----------------------------------------------------------------HOLD File for GRAPH-------------------------------------------------------------------------
TABLE FILE MOREOUT PRINT
COUNTER NOPRINT COMPUTE YEARNEW/I7 = IF COUNTER EQ 1 THEN YEAR_OF_CREATING ELSE 2018 ; NOPRINT COMPUTE MONTHNEWVAR/I7 = IF COUNTER EQ 1 THEN MOUNT_OF_CREATION ELSE LAST MONTHNEWVAR + 1 ; NOPRINT COMPUTE FLAG/I2 = IF COUNTER EQ 2 THEN FLAG + 1 ELSE 0; NOPRINT COMPUTE NEWVALUE/I7 = IF COUNTER EQ 2 THEN &LASTVALUE + (FLAG * &DIFFRENCEVALUE) ELSE WBS_COST ;
BY DATES4 ON TABLE HOLD AS 'SAP_CR' FORMAT ALPHA END
-*--------------------------------------------------------------GRAPH File for SAP CR Pipeline------------------------------------------------------------------
GRAPH FILE SAP_CR PRINT NEWVALUE AS '' BY DATES4 AS '' ON GRAPH SET LOOKGRAPH VBAR -*ON GRAPH PCHOLD AS CHART3 FORMAT JSCHART ON GRAPH SET GRAPHEDIT SERVER ON GRAPH SET 3D OFF ON GRAPH SET VZERO OFF ON GRAPH SET GRID OFF ON GRAPH SET HAXIS 758 ON GRAPH SET VAXIS 415 ON GRAPH SET UNITS PIXELS ON GRAPH SET GRMULTIGRAPH 0 ON GRAPH SET GRLEGEND 0 ON GRAPH SET GRXAXIS 3 ON GRAPH SET BARNUMB ON ON GRAPH SET GRAPHSTYLE * setTextString(getTitle(),"Request for Change (Major) – Cost"); setTextDisplay(getTitle(),true); setReportParsingErrors(false); setSelectionEnableMove(false); setRiserWidth(25); setFillColor(getSeries(0),new Color(53,125,145)); setFillColor(getSeries(1),new Color(53,125,145)); setFillColor(getSeries(2),new Color(53,125,145)); setFillColor(getSeries(3),new Color(53,125,145)); setFillColor(getSeries(4),new Color(53,125,145)); setFillColor(getSeries(5),new Color(0,60,125)); setFillColor(getSeries(6),new Color(0,60,125)); setFillColor(getSeries(7),new Color(0,60,125)); setFillColor(getSeries(8),new Color(0,60,125)); setFillColor(getSeries(9),new Color(0,60,125));
-------------------------------------------------------TABLE File for SAP CR Pipeline----------------------------------------------------------------------
TABLE FILE SAP_CR SUM NEWVALUE ACROSS DATES4 AS '' ON TABLE SET PAGE-NUM NOLEAD ON TABLE SET ASNAMES ON ON TABLE PCHOLD FORMAT HTML ON TABLE SET HTMLEMBEDIMG ON ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * INCLUDE = endeflt, $ TYPE=REPORT, BORDER=ON, GRID=ON, SQUEEZE=OFF, FONT=CALIBRI, WRAP=0.32000, $ ENDSTYLE END
-FOC_ERROR -SET &FOC_ERRMSG = FEXERR(&FOCERRNUM,'A100'); -HTMLFORM BEGIN No Data Available for 'Request for change cost' report , Please verify filters -
-HTMLFORM ENDThis message has been edited. Last edited by: FP Mod Chuck,
-*Examine the output by using the &RECORDS or &LINES variables that are automatically generated after your fex runs.
-*If the procedure returns NO RECORDS, then present an ERROR PAGE.
TABLE FILE SAP_CR
SUM
NEWVALUE
ACROSS
DATES4 AS ''
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
TYPE=REPORT, BORDER=ON, GRID=ON, SQUEEZE=OFF, FONT=CALIBRI, WRAP=0.32000,
$
ENDSTYLE
END
-IF &RECORDS EQ 0 THEN GOTO :NODATAFOUND ELSE :ENDOFILE;
-GOTO :ENDOFILE
-:NODATAFOUND
-HTMLFORM BEGIN
<html>
<head>
<div>
<div style="width:100%;float:left;padding:5;margin:5;vertical-align: middle;text-align: center; color: red" >
<span style="font-size:18">No Data Found</span>
</div>
</div>
-*
</body>
</html>
-HTMLFORM END
-:ENDOFILE
Here's a sample file based version of Don's code. Can you test it and see if it works? Try CHINA for country. If it does, you should be able to just reuse his code by replacing just the TABLE FILE... END with your own.
TABLE FILE CAR
SUM
SALES
WHERE COUNTRY EQ '&COUNTRY';
END
-IF &RECORDS NE 0 THEN GOTO :ENDOFILE;
-HTMLFORM BEGIN
<html>
<head>
<div>
<div style="width:100%;float:left;padding:5;margin:5;vertical-align: middle;text-align: center; color: red" >
<span style="font-size:18">No Data Found</span>
</div>
</div>
-*
</body>
</html>
-HTMLFORM END
-:ENDOFILE
WebFOCUS 8206, Unix, Windows
Posts: 1853 | Location: New York City | Registered: December 30, 2015
The code mentioned by me above in that I want the error message to only pop up when there is a wrong or error selection. But I get the error msg also when the report is running. What corrections do I need to make ??
You need to "jump" over the error message when you do have output. The way it is now, after the last TABLE FILE the code just continues on into the error code.
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
Originally posted by Wep5622: You need to "jump" over the error message when you do have output. The way it is now, after the last TABLE FILE the code just continues on into the error code.
I have added the particular line of code where i an facing this issue. -IF &LINES NE 0 GOTO :ENDOFILE; and then after html end added -:ENDOFILE
It gives me an output saying: 2017 2 0 NUMBER OF RECORDS IN TABLE= 28 LINES= 5 0 NUMBER OF RECORDS IN TABLE= 5 LINES= 5 0 NUMBER OF RECORDS IN TABLE= 1 LINES= 1