Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

No output. How to make a nice stylish message for the end user?

Status
Not open for further replies.

kaeserea

Programmer
Feb 26, 2003
164
DE
Hello!

If my report generates no output (e.g. the report does not have any data for the chosen time period) I'd like to give the user a nice message a la "Sorry no data for this time period." instead of the webfocus message.

I tried EMPTYREPORT=ON which generates a nicer message than without this line. Yet webfocus still displays a lot of information that confuses the user.

Can anybody help?
Thanx a lot.
Eva
 
Build a html-page with a user-friendly message to tell the user there is no data.
In your request you can ask Focus if the table has output by reacting on the Focus-variable &LINES. Then you can branch to your message:

Code:
TABLE FILE filename
  PRINT fields
  ON TABLE HOLD AS XX FORMAT HTMTABLE
END
-RUN
-IF &LINES EQ 0 THEN GOTO NO_OUTPUT;
-* Output:
-HTMLFORM XXOUTPUT
-EXIT
-* No output:
-NO_OUTPUT
-HTMLFORM NOOUTPUT
-EXIT
Frank van de Kant
 
Hello Frank,

I don't understand the line -HTMLFORM XXOUTPUT. what do I have to insert here?

Eva
 
The file XXOUTPUT.HTML or XXOUTPUT.HTM is a file in your HTML-dir with the following code in it:
Code:
<html>
 !IBI.FIL.XX;
</html>
The variable !IBI.FIL.XX; refers to a file with name XX in the focus path including its temppath.
The HTML-file XXOUTPUT can contain normal HTML-statements including styling, title, meta-tags etc.

The Focus-command
Code:
-HTMLFORM filename
means that Focus loads this file and shows it in the browser of the user.

But off course Focus has an alternative:
Code:
-HTMLFORM BEGIN
put some html-code here
-HTMLFORM END
Frank van de Kant
 
Hello Frank,

sorry to ask you again, but no matter what I fill in for [tt]filename[/tt] I always get the error:

there was a error running 'app/test4.fex' this error has to to with the file 'xxoutput.htm ' it may be missing the internal errorcode was '1023'

Eva
 
Eva,

Don't worry about asking again. You can send me the fex by mailid:info@explicit.nl

I will have a look and reply an example. As usual there a several options to solve this problem. Frank van de Kant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top