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     [CLOSED] Displaying message when the report is empty for multiple Excel tabs

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Displaying message when the report is empty for multiple Excel tabs
 Login/Join
 
Silver Member
posted
Hi,

My requirement is to produce multiple Excel tabs.If there are no records in one particular tab I should display "There are no records".

 

SET COMPOUND=OPEN

TABLE FILE CAR
PRINT SEATS
WHERE SEATS EQ '2';
ON TABLE PCHOLD FORMAT EXL2K
END

-IF &LINES EQ 0 THEN GOTO TABLE1 ELSE GOTO OTHERS;

-TABLE1
TABLE FILE CAR
PRINT SEATS NOPRINT
HEADING
"There are no records"
ON TABLE PCHOLD FORMAT EXL2K
END

-OTHERS
SET COMPOUND=CLOSE

TABLE FILE CAR
PRINT SEATS
WHERE SEATS EQ '6';
ON TABLE PCHOLD FORMAT EXL2K
END

-IF &LINES EQ 0 THEN GOTO TABLE2 ELSE GOTO OTHERS1;

-TABLE2

TABLE FILE CAR
PRINT SEATS NOPRINT
HEADING
"There are no records"
ON TABLE PCHOLD FORMAT EXL2K
END

-OTHERS1

-EXIT


 


Here is my code.If the first report(tab) has zero records, the message is being displayed correctly.But for the second tab,if there are zero records I don't see the second tab with the messagae.I am not sure why this is happening.where am I going wrong.Could some one help me.

Thanks

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


WebFOCUS 7.6.7
windows
Html,Pdf and Excel
 
Posts: 39 | Registered: September 03, 2010Report This Post
Expert
posted Hide Post
Because it's a compound report, the second report closes the compound report, even though there's no data. Here is one solution - create a compound report with a dummy last report:

SET COMPOUND=OPEN
-RUN

TABLE FILE CAR
PRINT SEATS
WHERE SEATS EQ 2;
ON TABLE PCHOLD FORMAT EXL2K
END
-RUN

-IF &LINES EQ 0 THEN GOTO TABLE1 ELSE GOTO OTHERS;

-TABLE1
TABLE FILE CAR
PRINT SEATS NOPRINT
HEADING
"There are no records"
ON TABLE PCHOLD FORMAT EXL2K
END
-RUN

-OTHERS
TABLE FILE CAR
PRINT SEATS
WHERE SEATS EQ 6;
ON TABLE PCHOLD FORMAT EXL2K
END
-RUN

-IF &LINES EQ 0 THEN GOTO TABLE2 ELSE GOTO OTHERS1;

-TABLE2

TABLE FILE CAR
PRINT SEATS NOPRINT
HEADING
"There are no records"
ON TABLE PCHOLD FORMAT EXL2K
END
-RUN

-OTHERS1

SET COMPOUND=CLOSE
-RUN

TABLE FILE CAR
PRINT SEATS
WHERE SEATS EQ 999;
ON TABLE PCHOLD FORMAT EXL2K
END
-RUN

-EXIT


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
Silver Member
posted Hide Post
That was helpful.Is this the only way to do this.


WebFOCUS 7.6.7
windows
Html,Pdf and Excel
 
Posts: 39 | Registered: September 03, 2010Report This Post
Expert
posted Hide Post
I think this is the only way.


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
Another possible way is to add this to the top of your report

SET EMPTYREPORT = ANSI


Although it will not say "There are no records" it will just not have any data rows but keeps everything else (heading, footing, and column titles). If that would be okay for your requirement instead.


WF: 8201, OS: Windows, Output: HTML, PDF, Excel
 
Posts: 78 | Registered: November 08, 2010Report This Post
Gold member
posted Hide Post
Add SET EMPTYREPORT = ON (or ANSI) and omit your branching statements.


WF 7703M, XP/Win7, MRE, RC, BID, PMF, HTML, PDF, Excel 2000/7/10
 
Posts: 73 | Location: NY | Registered: February 06, 2007Report This Post
Member
posted Hide Post
SET EMPTYREPORT = ON

SET COMPOUND=OPEN

TABLE FILE CAR
PRINT SEATS
WHERE SEATS EQ '2';
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET STYLE *
TYPE=REPORT, FONT='Arial', SIZE=8, STYLE=NORMAL, TITLETEXT='Report 1',$
ENDSTYLE
END

TABLE FILE CAR
PRINT SEATS NOPRINT
HEADING
"There are no records"
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET STYLE *
TYPE=REPORT, FONT='Arial', SIZE=8, STYLE=NORMAL, TITLETEXT='Empty 1',$
ENDSTYLE
END

TABLE FILE CAR
PRINT SEATS
WHERE SEATS EQ '6';
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET STYLE *
TYPE=REPORT, FONT='Arial', SIZE=8, STYLE=NORMAL, TITLETEXT='Report 2',$
ENDSTYLE
END

SET COMPOUND=CLOSE

TABLE FILE CAR
PRINT SEATS NOPRINT
HEADING
"There are no records"
ON TABLE PCHOLD FORMAT EXL2K
ON TABLE SET STYLE *
TYPE=REPORT, FONT='Arial', SIZE=8, STYLE=NORMAL, TITLETEXT='Empty 2',$
ENDSTYLE
END
 
Posts: 12 | Location: Dallas, TX | Registered: November 02, 2011Report This Post
Member
posted Hide Post
quote:
SET EMPTYREPORT = ANSI

SET EMPTYREPORT = ANSI

That did it for me.. thanks a lot


WebFocus 768
Windows, all output
 
Posts: 18 | Registered: June 20, 2011Report 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     [CLOSED] Displaying message when the report is empty for multiple Excel tabs

Copyright © 1996-2020 Information Builders