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] Handling No Data Error Message in Compound report in EXL2K format
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] Handling No Data Error Message in Compound report in EXL2K format
 Login/Join
 
Member
posted
Hi,

I am stuck on a situation to display custom error message in compound report in EXL2K (having 2 or more than 2 sheets). To display custom error message, I include a .fex file to program based on a below condition:

-IF &LINES EQ 0 THEN GOTO ERRORMSG;
-ERRORMSG
-INCLUDE ERROR_MESSAGE.FEX

-GOTO END_RPT


I don't want to used to hold data and print error message based on the no of records in hold file(should satisfied above condition). I want to print data directly from database like below:

TABLE FILE CAR
SUM
AMOUNT
RATE
BY MODEL
WHERE COUNTRY EQ 'INDIA';
ON TABLE PCHOLD FORMAT EXL2K OPEN
END

-IF &LINES EQ 0 THEN GOTO ERRORMSG1 ELSE GOTO SKIP_ERRORMSG1;
-ERRORMSG1
-INCLUDE ERROR_MESSAGE.FEX

-SKIP_ERRORMSG1

TABLE FILE CAR
SUM
AMOUNT
RATE
BY MODEL
WHERE COUNTRY EQ 'U.K.';
ON TABLE PCHOLD FORMAT EXL2K CLOSE
END

-IF &LINES EQ 0 THEN GOTO ERRORMSG2 ELSE GOTO SKIP_ERRORMSG2;
-ERRORMSG2
-INCLUDE ERROR_MESSAGE.FEX

-SKIP_ERRORMSG2



Problem situation:
Suppose there is situation when there is data only for 'INDIA' not for 'U.K.', then 2nd PCHOLD will close and report will not print any record. After that processor reads condition for error message, which comes true. But report will not include this error message sheet because compound report got closed in 2nd PCHOLD.

Please suggest me here any best approach to deal with this problem situation.


Thanks,
Sandeep Sagar

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 25 | Registered: September 15, 2014Reply With QuoteReport This Post
Guru
posted Hide Post
Is there any specific reason, you should not hold the data?

&LINES wont be assigned until the TABLE FILE request ends either as a HOLD or a PCHOLD...

One simple solution is something as below. Have a dummy sheet at the end printing nothing...

 

TABLE FILE CAR
SUM
SALES
BY MODEL
WHERE COUNTRY EQ 'JAPAN';
ON TABLE PCHOLD FORMAT EXL2K OPEN
END

-IF &LINES EQ 0 THEN ERRORMSG1 ELSE SKIP_ERRORMSG1; 
-ERRORMSG1
-INCLUDE error_message.fex 

-SKIP_ERRORMSG1

TABLE FILE CAR
SUM
SALES
BY MODEL
WHERE COUNTRY EQ 'INDIA';
ON TABLE PCHOLD FORMAT EXL2K
END

-IF &LINES EQ 0 THEN ERRORMSG2 ELSE SKIP_ERRORMSG2; 
-ERRORMSG2
-INCLUDE error_message.fex
-SKIP_ERRORMSG2

TABLE FILE CAR
PRINT
CAR NOPRINT
ON TABLE PCHOLD FORMAT EXL2K CLOSE
ON TABLE SET STYLE *
TYPE=REPORT, TITLETEXT='x',$
END


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
 
Posts: 394 | Location: Chennai | Registered: December 02, 2009Reply With QuoteReport This Post
Member
posted Hide Post
Thanks for your suggestion Ram.

I already go ahead with this approach but my WF Manager does not want solution like this way. He suggests me to passes data as minimum as possible. That's the reason to not use HOLD file.
In this approach, we call TABLE 3 times, but I want solution in 2 calls only.


Thanks,
Sandeep Sagar


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 25 | Registered: September 15, 2014Reply With QuoteReport This Post
Guru
posted Hide Post
quote:
&LINES wont be assigned until the TABLE FILE request ends either as a HOLD or a PCHOLD...


Hopefully it can't be. Let us see, if someone else has something with this.


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
 
Posts: 394 | Location: Chennai | Registered: December 02, 2009Reply With QuoteReport This Post
Virtuoso
posted Hide Post
You might try:

SET EMPTYREPORT = ON

This should cause a blank sheet to be created when there is no data.

or....

SET EMPTYREPORT = ANSI

..will cause a blank sheet with headings and column titles to be created.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Reply With QuoteReport This Post
Expert
posted Hide Post
Also, please add a -RUN after the TABLE requests.

Dialog Manager is evaluated before TABLE requests, and &LINES will not be correct.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6280 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Reply With QuoteReport This Post
Member
posted Hide Post
Hi Dan,

Thanks for your suggestions.
By using SET EMPTYREPORT = ON, I get the report with having column name and heading information. But here is different scenario for me.
I have another .fex file for displaying error message on the report when there is not data found in Database. This error message may be one of given below:
1. WebFocus Error Code
2. No data found in Database

Also, report output needs to display heading information, image/logo and footer information(Footer information can be achieved by using SET EMPTYREPORT = ANSI).

My main motive is "To include my custom error message .fex file by using only two passes of data (If there only sheets in the report)."


Thanks,
Sandeep Sagar


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 25 | Registered: September 15, 2014Reply With QuoteReport This Post
Master
posted Hide Post
We have had the same requirement and there is no real solution outside of validating if data is returned and if not, including a no data fex. The only way to do that is to use a hold file.



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Here's an approach that might work. My embedded error logic would be replaced with your -INCLUDE ERRORMSG.FEX. You can uncomment one or both of the WHERE clauses to see how report failures are handled.

-* Set EMPTYREPORT off so empty sheets are not created.
SET HOLDLIST    = PRINTONLY
SET ASNAMES     = ON
SET EMPTYREPORT = OFF
-*
-* Run the first report request, which opens the spreadsheet file.
TABLE FILE CAR
 SUM SALES
 BY COUNTRY
 BY CAR
-* WHERE COUNTRY EQ 'INDIA';
 ON TABLE PCHOLD FORMAT EXL07 OPEN
END
-*
-RUN
-* If the first report request produces output, go to the second report request.
-IF (&LINES GT 0) GOTO :RPT_2 ;
-*
-* If the first report request fails, display an error message.
TABLE FILE CAR
 HEADING
  "Your first report did not produce any output."
 PRINT COUNTRY NOPRINT
 WHERE RECORDLIMIT EQ 1 ;
 ON TABLE PCHOLD FORMAT EXL07
END
-RUN
-*
-:RPT_2
-*
-* Run the second report request.
TABLE FILE CAR
 SUM RETAIL_COST
 BY COUNTRY
 BY CAR
-* WHERE COUNTRY EQ 'SPAIN';
 ON TABLE PCHOLD FORMAT EXL07
END
-*
-RUN
-* If the second report request produces output, go to a final dummy request to close the spreadsheet.
-IF (&LINES GT 0) GOTO :CLOSE_RPT ;
-*
-* If the second report request fails, display an error message.
TABLE FILE CAR
 HEADING
  "Your second report did not produce any output."
 PRINT COUNTRY NOPRINT
 WHERE RECORDLIMIT EQ 1 ;
 ON TABLE PCHOLD FORMAT EXL07
END
-RUN
-*
-:CLOSE_RPT
-* The only purpose of this final dummy report request is to close the spreadsheet file.
TABLE FILE CAR
 PRINT COUNTRY
 WHERE COUNTRY EQ 'NONSENSE';
 WHERE RECORDLIMIT EQ 1 ;
 ON TABLE PCHOLD FORMAT EXL07 CLOSE
END
-RUN

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Reply With QuoteReport This Post
Guru
posted Hide Post
quote:
In this approach, we call TABLE 3 times, but I want solution in 2 calls only.

Hello Dan,

I suggested the same.. He is not fine with that solution. Smiler

Thanks,
Ram.


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
 
Posts: 394 | Location: Chennai | Registered: December 02, 2009Reply With QuoteReport This Post
Expert
posted Hide Post
One thing that I would remind you about when using an -INCLUDE multiple times within the same procedure and that is that you should ensure that you do not use GOTO [Label] syntax as you could inadvertently cause a loop.

So, what is the most important thing to achieve here? Is it to produce a report with the minimal amount of data handling or is it to produce the error message(s)?

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 
 
Posts: 5687 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Handling No Data Error Message in Compound report in EXL2K format

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.