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] Webfocus Newbie Question

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Webfocus Newbie Question
 Login/Join
 
Member
posted
I am new to webfocus and i am trying to achieve the following , I have this code below


TABLE FILE CAR
PRINT COUNTRY CAR MODEL
WHERE CAR EQ 'JAGUAR'
END

this prints


COUNTRY CAR MODEL
ENGLAND JAGUAR V12XKE AUTO
ENGLAND JAGUAR XJ12L AUTO


Now when i run

TABLE FILE CAR
PRINT COUNTRY CAR MODEL
WHERE CAR EQ 'JAG'
END

I get


0 NUMBER OF RECORDS IN TABLE= 0 LINES= 0



I want the result to be

COUNTRY CAR MODEL
no result found


Please how do i achieve this ??

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


WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
 
Posts: 20 | Registered: July 06, 2010Report This Post
Expert
posted Hide Post
There is a couple of ways to do this, but I would suggest checking the &LINES after the TABLE FILE, and if they are zero, show the empty report.
TABLE FILE CAR
PRINT COUNTRY CAR MODEL
WHERE CAR EQ 'JAG'
END

-RUN

-IF &LINES GT 0 THEN GOTO NEXT_BIT ;

SET EMPTYREPORT = ANSI
TABLE FILE CAR
PRINT COUNTRY CAR MODEL
FOOTING
"no result found "
WHERE CAR EQ 'JAG'
END

-EXIT

-NEXT_BIT


I would also suggest checking out the Dialog MAnager stuff (lines that begin with a dash) and the SET commands. They will help.


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
Virtuoso
posted Hide Post
You could also try using a DUMMY support field and a conditional SUBFOOT to achieve a similar effect while doing only 1 pass over your data:

-DEFAULT &P_CAR = 'JAG';

SET EMPTYREPORT = ANSI

DEFINE FILE CAR
DUMMY/A1 = 'X';
END

TABLE FILE CAR
PRINT COUNTRY CAR MODEL
BY DUMMY NOPRINT

ON DUMMY SUBFOOT
"no result found "
WHEN DUMMY NE 'X';

WHERE CAR EQ '&P_CAR'
END



The EMPTYREPORT = ANSI setting indicated by Waz is the key element for either approach to work.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Member
posted Hide Post
Yes thanks for the reply. Can i achieve this without putting this in the footing?? I come from a jasper report environment and this is extremely easy in that environment


WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
 
Posts: 20 | Registered: July 06, 2010Report This Post
Virtuoso
posted Hide Post
Can you? well ... with more work involved, you could perhaps create a fake record and put it there after you verified that no data was found, but the FOOTING/SUBFOOT is much easier.

The question is ... why don't you want to use a FOOTING/SUBFOOT? What difference does it make to your business users who will be ones consuming the report?



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Member
posted Hide Post
client requirements, Date is the only entry that is supposed to be in the footing


WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
 
Posts: 20 | Registered: July 06, 2010Report This Post
Virtuoso
posted Hide Post
Is the FOOTING at the bottom of the page? Use then a SUBFOOT as I showed above. The message will show up right below the column titles ad well above the actual FOOTING.

-DEFAULT &P_CAR = 'JAG';

SET EMPTYREPORT = ANSI
SET NODATA = ' '

DEFINE FILE CAR
DUMMY/A1 = 'X';
END

TABLE FILE CAR
PRINT COUNTRY CAR MODEL
BY DUMMY NOPRINT

ON DUMMY SUBFOOT
"no result found "
WHEN DUMMY NE 'X';

WHERE CAR EQ '&P_CAR'

ON TABLE PCHOLD FORMAT PDF

FOOTING BOTTOM
"Run Date: &YYMD"
END



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Member
posted Hide Post
Thanks fellows i really appreciate, when i ran the code

i got




COUNTRY CAR MODEL

no result found

Run Date: 20120216



this would have been okay but there should be no line between the title and the "no result found" it should be


COUNTRY CAR MODEL
no result found

Run Date: 20120216


WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
 
Posts: 20 | Registered: July 06, 2010Report This Post
Expert
posted Hide Post
You can shift things around...

TABLE FILE CAR
PRINT COUNTRY CAR MODEL
WHERE CAR EQ 'JAG'
END

-RUN

-IF &LINES GT 0 THEN GOTO NEXT_BIT ;

SET EMPTYREPORT = ANSI
SET NODATA = ' '
DEFINE FILE CAR
 DUMMY/A1 = ' ' ;
END
TABLE FILE CAR
PRINT COUNTRY CAR MODEL
BY DUMMY NOPRINT
ON DUMMY SUBHEAD
"no result found "
WHERE CAR EQ 'JAG'
FOOTING
"Run Date: &YYMD"
END

-EXIT

-NEXT_BIT


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
Lovely Big Grin

It works, starting to enjoy webfocus


WebFOCUS 7.6.9
Windows
all output (Excel, HTML, PDF)
 
Posts: 20 | Registered: July 06, 2010Report This Post
Expert
posted Hide Post
Yay,

Another convert.

Resistance is Futile....



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
Guru
posted Hide Post
This doesn't really directly answer the question but thought I'd share it anyway.

Most of our reports go on some HTML webpage so, at the end of most of our reports we just tack on a standard empty-report html page.

Like so:

TABLE FILE CAR
PRINT COUNTRY CAR MODEL
WHERE CAR EQ 'JAG'
END
-IF &FOCERRNUM NE 0 THEN GOTO :ERROR;
-IF &LINES EQ 0 THEN GOTO :EMPTYRPT;
-GOTO :ENDFEX


And so, in the bottom of every report (well, it's actually just -included usually) is the following:
-:ERROR
-HTMLFORM SPLASH_ERROR
-GOTO :ENDFEX
-:EMPTYRPT
-HTMLFORM SPLASH_EMPTY
-GOTO :ENDFEX
-:ENDFEX


And then we have a standard HTML page called SPLASH_ERROR.htm and SPLASH_EMPTY.htm that shows a fancy message with a support contact number in case this is not what the user expects.

Hope this helps.


WF 8.1.05 Windows
 
Posts: 333 | Location: Orlando, FL | Registered: October 17, 2006Report This Post
Expert
posted Hide Post
This type of think was discussed a year or two ago.

We have similar.

At the bottom of the page, we have error handling and empty report.


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
  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] Webfocus Newbie Question

Copyright © 1996-2020 Information Builders