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. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.


Connect to myibi
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: 2410 | 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