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] AHTMLTAB breaks when there is NO DATA

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] AHTMLTAB breaks when there is NO DATA
 Login/Join
 
Member
posted
Hi,
I have 2 reports that work great using AHTMLTAB in the HTMLFORM BEGIN and HTMLFORM END. However, when a Table File request does not bring back any data, the Active Report breaks. Is there a way to reset the system variable each time a request is made or capture the results of a table request Records or Lines in a variable? The &RECORD variable will contain the results of the first query and I can not use it for other queries to write out a NO DATA report. Any help would be greatly appreciated.

-*CHECK TO SEE IF I HAVE DATA FOR REPORT 1
TABLE FILE GGSALES
SUM DOLLARS UNITS
BY REGION
BY ST
BY CITY
ON TABLE HOLD
-SET &RECORDS = &RECORDS * 1 ;
-SET &LINES = &LINES * 1 ;
-IF &RECORDS = 0 THEN GOTO :NoData1 ELSE Big GrinataToShow;

-:NoData1
write a no data message

-Big GrinataToShow
TABLE FILE GGSALES
SUM DOLLARS UNITS
BY REGION
BY ST
BY CITY
HEADING "Regional Sales Summary"
ON TABLE HOLD AS REPORT1
FORMAT AHTMLTAB
ON TABLE SET STYLE *
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,
$
TYPE=REPORT,
OBJECT=STATUS-AREA,
PAGE-LOCATION=OFF,
$
END
-*CHECK TO SEE IF I HAVE DATA FOR REPORT 2
TABLE FILE GGSALES
SUM DOLLARS UNITS
BY CATEGORY
BY PRODUCT
ON TABLE HOLD
-IF &RECORDS = 0 THEN GOTO :NoData2 ELSE Big GrinataToShow2;

-:NoData2
write a no data message

-Big GrinataToShow2
TABLE FILE GGSALES
SUM DOLLARS UNITS
BY CATEGORY
BY PRODUCT
HEADING "Production Order Summary"
WHERE CATEGORY = 'KEN'
ON TABLE HOLD AS REPORT2
FORMAT AHTMLTAB
ON TABLE SET STYLE *
INCLUDE=IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty,
$
TYPE=REPORT,
OBJECT=STATUS-AREA,
PAGE-LOCATION=OFF,
$
END -*
-HTMLFORM BEGIN


Displaying HTML Active Technologies Reports on an HTML Web Page


!IBI.OBJ.ACTIVEREPORTJS;






!IBI.FIL.REPORT1; !IBI.FIL.REPORT2;



-HTMLFORM END

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8202M, Windows, All Outputs
 
Posts: 4 | Registered: March 14, 2018Report This Post
Virtuoso
posted Hide Post
ALWAYS use code tag when posting code sample
Last icon on the ribbon that looks like the below
</>


Pay attention : &RECORDS contain the number of record found/read where &LINES it's the number of records in the data set (returned) : in the HOLD file
You should better test &LINES

Also why doing
-SET &RECORDS = &RECORDS * 1 ;

&RECORDS and &LINES are already a number...

Except if you miss copied your code but you are missing key word END after your TABLE FILE … ON TABLE HOLD

To save BOTH "result" row number
-*CHECK TO SEE IF I HAVE DATA FOR REPORT 1
TABLE FILE GGSALES
SUM DOLLARS UNITS
-*WHERE CATEGORY = 'KEN';
ON TABLE HOLD
END
-RUN

-SET &RPT1 = &LINES;

-*CHECK TO SEE IF I HAVE DATA FOR REPORT 2
TABLE FILE GGSALES
SUM DOLLARS UNITS
-*WHERE CATEGORY = 'KEN';
ON TABLE HOLD
END
-RUN

-SET &RPT2 = &LINES;


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     [CLOSED] AHTMLTAB breaks when there is NO DATA

Copyright © 1996-2020 Information Builders