Focal Point
[CLOSED] How to give message if records not found

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

October 18, 2010, 06:14 AM
MH
[CLOSED] How to give message if records not found
Hi,

I have created one procedure and then launched that procedure through HTML page. I have four parameters in the report. In some combinations records do no exist. In this case a new window popup with the following message

No HTML Output!

--------------------------------------------------------------------------------


0 NUMBER OF RECORDS IN TABLE= 126 LINES= 126
ACCESS LIMITED BY PASSWORD
0 NUMBER OF RECORDS IN TABLE= 126 LINES= 126
0 NUMBER OF RECORDS IN TABLE= 0 LINES= 0

First thing it should not open the new window becuase if it finds records it displays in the same window. so it should display the above message in the same window as well.
Instead of this message i would like to display the message in the same frame instead of opening a new page. i.e. Records do not exist against your search criteria. in the same frame.

This message has been edited. Last edited by: Kerry,


WebFOCUS 7.6
Windows, All Outputs
October 18, 2010, 10:08 AM
Dave
MH,

This probably is already somewhere in this forum. Use search...


anyway:

TABLE FILE (your query)
END

-RUN

-IF &LINES NE 0 THEN GOTO ENDIF
-HTMLFORM BEGIN
<HTML><BODY>No results found.</BODY></HTML>
-HTMLFORM END
-ENDIF


Unchecked, but it's something like this.

greets,
Dave


_____________________
WF: 8.0.0.9 > going 8.2.0.5
October 18, 2010, 10:31 AM
MH
Thank you Dave for your reply. I will try this. But it is opening in a new window. I have not mentioned it to open the result in a new window. why does it open a new window, any idea?


WebFOCUS 7.6
Windows, All Outputs
October 18, 2010, 10:56 AM
MH
Hi Dave I have tried your code. I am getting this error

(FOC261) EXPRESSION IS INCOMPLETE BECAUSE AN OPERATION IS MISSING

any idea?i dont know about the syntax because this language is completely new for me.


WebFOCUS 7.6
Windows, All Outputs
October 18, 2010, 11:17 AM
Francis Mariani
quote:
because this language is completely new for me.

Isn't this the right time to read the manual? Also, with the correct search criteria, you will find a lot of solutions on this forum.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
October 19, 2010, 03:13 AM
Dave
Like I said...

- It's unchecked...
- Use search...

and I agree with Francis.
If you are planning to learn webfocus through this forum...
...don't.



by the way...
a ; is missing at the end of the line starting with the -IF


_____________________
WF: 8.0.0.9 > going 8.2.0.5
October 19, 2010, 03:31 AM
Wep5622
Besides checking the number of lines returned you'll probably also want to check that no error occurred. If I recall correctly the variable to check for that case is &FOCERRNUM - that's a bit harder to find, especially if you're (like me) used to errno.h in C, that's why I mention it here Wink


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
October 19, 2010, 04:34 AM
MH
Thank you everyone for the prompt reply. Now it works fine when i run individual procedure.

It is still opening a new window when I call the same procedure in HTML.
I have created one HTML page and on a button Hyperlink property I have given the procedure name in the source and Frame name in the target. Not sure why it is opening a new window.
Any idea?


WebFOCUS 7.6
Windows, All Outputs
October 20, 2010, 11:45 AM
EWoerle
If the report is opening in a new window, then that command is being issued at the time the report is being run and not by anything in the code that Dave supplied.

If you created your own HTML page, I would start looking there as that is probably where your issue is. Check the XML REQUEST tag to see where it is telling the report to open up.

 
<request requestid="0" targettype="0" targetname="_blank" sourcetype="typeFex" ibif_ex="app/car.fex" IBIMR_folder="#car" ibiapp_app="">
 


Above is an example of xml from one of my reports. Notice how I have targetname="_blank". that is the request that tells the report in what window to put the report. I want it to go into a new window so I said _blank. To put the report into a frame on the page you would use the frame name for that element. If you want it to replace the current page you would use _parent.

If this isn't what you need then please also include your html code and focus code so that we can better understand what you are trying to acheive. Otherwise we are guessing and won't be able to effectively help you.


Eric Woerle
WF 7.6.7 Reportting Server
ETL 7.6.10
Dev Studio 7.6.7
October 26, 2010, 04:09 AM
MH
Hi,

Thanks everyone. No record message is resolved but it opens in a new window is still there. I am trying to resolve that but was busy in some other work. Will update here later


WebFOCUS 7.6
Windows, All Outputs
October 26, 2010, 09:12 AM
ABT
A more webfocus-centric approach. Same basic code, just a different implementation. May solve the empty HTML window issue.

quote:

TABLE FILE CAR
PRINT
*
WHERE MODEL EQ 'POTATO';
ON TABLE HOLD AS MYREPORT
END

-IF &LINES EQ 0 THEN GOTO NORECS ELSE GOTO DOREPORT;

-NORECS
-TYPE +---------------------------------------------+
-TYPE | No records have been returned for this |
-TYPE | request. Please try again later or with |
-TYPE | different criteria. |
-TYPE +---------------------------------------------+
-GOTO ENDIF


-DOREPORT
TABLE FILE MYREPORT
PRINT
*
END
-GOTO ENDIF


-ENDIF



------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro