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.
I have a dilemma. I have a report that outputs to Excel. I want it so that when there are no lines in the report (&LINES EQ 0), Excel will not fire, instead, a No Records message is displayed on the html page.
Unfortunately, I have a WHERE TOTAL on the report. For some insane reason, if the report is empty because it doesn't meet WHERE TOTAL critera, the Report Headers are still displayed (similar to having EMPTYREPORT=ON) and the Excel fires. How do I fix this?
Sample Code (output to HTML for simplicity):
TABLE FILE CAR
SUM BODYTYPE
COMPUTE TEST/A4 = IF LST.RETAIL_COST GT 1000 THEN 'RETL' ELSE IF LST.DEALER_COST GT 1000 THEN 'DEAL';
BY COUNTRY
BY CAR
WHERE TOTAL TEST EQ 'RETL';
WHERE COUNTRY EQ 'NONE';
ON TABLE SUBHEAD
"Just Testing "
" "
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
GRID=OFF,
FONT='ARIAL',
SIZE=9,
$
TYPE=TITLE,
STYLE=BOLD,
JUSTIFY=CENTER,
BACKCOLOR='NAVY BLUE',
COLOR='WHITE',
$
TYPE=TABHEADING,
SIZE=12,
STYLE=BOLD,
$
ENDSTYLE
END
-RUN
-IF &FOCERRNUM NE 0 GOTO DBERR;
-IF &LINES EQ 0 GOTO NORECORDS;
-GOTO ENDFEX
-NORECORDS
-TYPE NO RECORDS
-GOTO ENDFEX
-DBERR
-TYPE CRITICAL ERROR
-ENDFEX
The example above produces the result I want - where the NO RECORDS message is displayed instead of the report headers.
If you change the WHERE CLAUSES to:
WHERE TOTAL TEST EQ 'NONE';
WHERE COUNTRY EQ 'ENGLAND';
Then I get the Report Headers even on &LINES EQ 0.
Methinks it's a webfocus bug... but that doesn't solve my dilemma...
Thanks!This message has been edited. Last edited by: Anatess,
I would do this with the help of a hold file. That will work as desired. The code I used:
TABLE FILE CAR
SUM BODYTYPE
COMPUTE TEST/A4 = IF LST.RETAIL_COST GT 1000 THEN 'RETL' ELSE IF LST.DEALER_COST GT 1000 THEN 'DEAL';
BY COUNTRY
BY CAR
WHERE TOTAL TEST EQ 'NONE';
WHERE COUNTRY EQ 'ENGLAND';
-*WHERE TOTAL TEST EQ 'RETL';
-*WHERE COUNTRY EQ 'NONE';
ON TABLE HOLD
END
-IF &FOCERRNUM NE 0 GOTO DBERR;
-IF &LINES EQ 0 GOTO NORECORDS;
TABLE FILE HOLD
SUM BODYTYPE
TEST
BY COUNTRY
BY CAR
ON TABLE SUBHEAD
"Just Testing "
" "
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
GRID=OFF,
FONT='ARIAL',
SIZE=9,
$
TYPE=TITLE,
STYLE=BOLD,
JUSTIFY=CENTER,
BACKCOLOR='NAVY BLUE',
COLOR='WHITE',
$
TYPE=TABHEADING,
SIZE=12,
STYLE=BOLD,
$
ENDSTYLE
END
-RUN
-IF &FOCERRNUM NE 0 GOTO DBERR;
-IF &LINES EQ 0 GOTO NORECORDS;
-GOTO ENDFEX
-NORECORDS
-TYPE NO RECORDS
-GOTO ENDFEX
-DBERR
-TYPE CRITICAL ERROR
-ENDFEX
Hope this helps ...
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007