Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] AHTMLTAB breaks when there is NO DATA
Go
New
Search
Notify
Tools
Reply
  
[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, 2018Reply With QuoteReport 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.0.1M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2159 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
  Powered by Social Strata  
 

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-2018 Information Builders, leaders in enterprise business intelligence.