Focal Point
Display footings if no data returned?

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7961051281

August 24, 2006, 08:55 AM
mark66
Display footings if no data returned?
Hi all,

I hope this is a very easy one to answer....

All of our reports will only display the Headings and Title if no data is returned from a query.

I don't think this looks too great and leaves the user wondering if the report has worked successfully or not!

Is there a switch or command to use so that I can display a message like "No data matches query" followed by the footing?

All of our reports follow the basic logic below:

TABLE FILE XXXX
PRINT ...
BY ...
WHERE ...
HEADING...
FOOTING...
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT EXL2K
END
-RUN
-EXIT


Cheers


WebFocus 765. iSeries v5r4
August 24, 2006, 09:36 AM
Tony A
Mark,

I tend to use a check at the end of the process to check the number of records or lines and then display an HTMLFORM if zero.

TABLE FILE whatever
blah blah blah
END
-RUN

-IF &RECORDS GT 0 THEN :Show_Rep;
-HTMLFORM BEGIN
<html>
<head>
<title>Error Report - No records</title>
</head>
<body>
<TABLE WIDTH="95%" CELLPADDING=0 style='margin-left:18pt;margin-right:18pt;margin-top:18pt;margin-bottom:18pt'>
 <TR>
  <TD>
    
  </TD>
 </TR>
 <TR>
  <TD style="vertical-align:bottom">
   <FONT SIZE=+1>The report you were running produced no results</FONT>
  </TD>
 </TR>
 <TR>
  <TD>
    1<BR /> 2<BR />
  </TD>
 </TR>
 <TR>
  <TD style="vertical-align:middle" height="200px">
   Please check your selections and rerun if required.
  </TD>
 </TR>
 <TR>
  <TD style='padding-left:0pt; vertical-align:bottom'>
   <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%">
    <TR>
     <TD>
      <span >Produced by : &USERID </span>
      <span >Page:</span>
      <span >1</span>
      <span > of </span>
      <span >1</span>
      <span >Created on :  &RepDate at &RepTime </span>
     </TD>
    </TR>
   </TABLE>
  </TD>
 </TR>
</TABLE>
</body>
</html>
-HTMLFORM END
-EXIT
-:Show_Rep


or something like that Smiler

If you add a section to check for &FOCERRNUM then you can also present a "standard" screen to motify of an error in the same manner.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
August 24, 2006, 09:57 AM
mark66
Thanks Tony,

This looks good, however is there a way to output the message on the returned Excel spreadsheet.

Currently the Excel looks like:

Title
Headings
-----------

I would like it to look like:

Title
Headings
"No data has been returned, please check your selections"
Footings
-----------


WebFocus 765. iSeries v5r4
August 24, 2006, 10:02 AM
Tony A
Hi Mark,

I always output the no records or error messages to HTML as it gives a constistant approach. Having the no records / error in PDF or Excel should be possible by using a dummy report approach -

TABLE FILE CAR
PRINT COMPUTE MESSAGE/A80 = 'There were no records meeting your request'; AS ''
BY COUNTRY
IF RECORDLIMIT EQ 1
ON TABLE PCHOLD FORMAT PDF (or EXL2K)
HEADING
blah
FOOTING
more blah
ON TABLE etc. etc.
END


But I find the constistant approach for these occurences more satisfactory as does the User (generally Smiler)

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10