December 20, 2007, 10:16 AM
<GGOFAnalyst>No Data Message in PDF
I have a drilldown that sometimes shows 0 for the amount so when the user drilldowns there obviously won't be any data. I want to show a message that says "No Data Found" when the user clicks on the drilldown. However, my format is PDF, can that be done in PDF?
Also, do I need to create a new fex or can I do all that in my report that shows what's in the drilldown?
December 20, 2007, 10:24 AM
PrarieDo a search on this forum and there are many examples of No Data Found fexes. Yes it can be done in PDF. You will have to add the No Data Found at the end of the drill down fex.
| In Focus since 1993. WebFOCUS 7.7.03 Win 2003 |
December 20, 2007, 02:25 PM
<GGOFAnalyst>I searched for how to do it and I came up with this:
-IF &LINES = 0 THEN GOTO NOREPORT ELSE GOTO PRINTOUT;
-NOREPORT
DEFINE FILE CAR
NORPT/A15 = 'NO DATA FOUND';
END
TABLE FILE CAR
PRINT
NORPT AS ''
COUNTRY NOPRINT
WHERE RECORDLIMIT EQ 1
-GOTO HSTYLE
-PRINTOUT
But this doesn't seem to work on PDF.
December 20, 2007, 02:31 PM
wf1998Use Following Code after -NOREPORT page
-NOREPORT
TABLE FILE CAR
SUM
CAR NOPRINT
HEADING CENTER
"3"
"<25>No Data to Display &DATE"
"<25>Date: <+0>&DATE<+0>; Time:<+0> &TOD<+0>"
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
END
-EXIT
Env Prod:WebFOCUS 7702 ,Windows xp on 64, SQL Server 2008, IRF Tool
Env 1 Local: DevStudio 7702 - MS Windows XP SP2 - Apache Tomcat 5.0.28
Output: HTML, Excel and PDF
December 20, 2007, 02:36 PM
Francis MarianiIt makes no difference what format of output you've selected for the report. The Dialogue Manager IF statement is executed regardless of format.
-IF &LINES EQ 0 THEN GOTO NOREPORT ELSE GOTO PRINTOUT;
-NOREPORT
-*-- Display empty report message
JOIN CLEAR *
TABLE FILE EXPENSEBASE
PRINT EXPENSEDATE NOPRINT
IF RECORDLIMIT EQ 1
IF READLIMIT EQ 1
ON TABLE SUBHEAD
" "
"-----------------------------------------------------------------------------"
"No Data was found for the selected parameters"
"-----------------------------------------------------------------------------"
" "
" "
ON TABLE HOLD AS HOLDREP1 FORMAT HTMTABLE
ON TABLE SET STYLE *
...
ENDSTYLE
END
-RUN
-EXIT
PRINTOUT
...
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
December 20, 2007, 02:47 PM
<GGOFAnalyst>Francis, I tried that as well in my drilldown report, pretty much exactly what you had. But that doesn't work either.
What is see when I run the report is a PDF file that looks like this:
0
F FYTD Actual
Category
____________________________________
December 20, 2007, 03:45 PM
Francis MarianiOK, this is most likely because you have SET EMPTYREPORT=ON.
If there is a HOLD file creation prior to the report,do the &LINES test just after the HOLD file creation, or do not code SET EMPTYREPORT=ON.
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
December 20, 2007, 03:57 PM
<GGOFAnalyst>I have the &Line after the HOLD file so I don't think that's the problem.
If I don't code the set emptyreport = on then I just get the No HTML Output screen.
December 20, 2007, 04:06 PM
Francis MarianiWhen you use -IF or -SET &.. this is Dialogue Manager. If you have WebFOCUS code (DEFINE, JOIN, TABLE, etc) between the Dialogue Manager code, unless you add a -RUN right after the END statement, the WebFOCUS code will NOT execute until all the Dialogue Manager code executes, so I always make sure I add a -RUN after each END statement and after a set of JOIN statements...
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
December 20, 2007, 04:14 PM
<GGOFAnalyst>Yea I learnt that in the intermediate WebFocus course that I took. So I hate to say it but I have -RUN after every JOIN and every END statement.
December 20, 2007, 05:09 PM
Francis MarianiCould it be the invalid syntax of the -IF statement:
-IF &LINES = 0
should be
-IF &LINES EQ 0
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
December 20, 2007, 05:18 PM
AnatessTry this:
Create fex 1 as follows:
-* File testdrilldown.fex
TABLE FILE CAR
SUM
BODYTYPE
SALES
BY COUNTRY
BY CAR
BY MODEL
HEADING
""
FOOTING
""
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='ARIAL',
SIZE=9,
$
TYPE=DATA,
COLUMN=N4,
FOCEXEC=testdrilldown2.fex(CNTRY=N1 CR=N2 BDYTYP=N4),
$
TYPE=DATA,
COLUMN=N4,
TARGET='_blank',
$
ENDSTYLE
END
-RUN
Then create drilldown fex (named testdrilldown2.fex) as follows:
-* File testdrilldown2.fex
-DEFAULT &CR='JAGUAR'
-DEFAULT &CNTRY='ENGLAND'
-DEFAULT &BDYTYP='CONVERTIBLE'
TABLE FILE CAR
SUM COMPUTE DEALER_NET/D7=SALES - DEALER_COST;
BY COUNTRY
BY CAR
BY BODYTYPE
HEADING
""
FOOTING
""
WHERE COUNTRY EQ '&CNTRY';
WHERE CAR EQ '&CR';
WHERE BODYTYPE EQ '&BDYTYP';
WHERE SALES GT 0;
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='ARIAL',
SIZE=9,
$
ENDSTYLE
END
-IF &RECORDS NE 0 THEN GOTO ENDFEX;
TABLE FILE CAR
SUM
CAR NOPRINT
HEADING CENTER
"<25>No Data to Display &DATE"
"<25>Date: <+0>&DATE<+0>; Time:<+0> &TOD<+0>"
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='ARIAL',
SIZE=9,
$
ENDSTYLE
END
-ENDFEX
-EXIT
Run the first fex and click on any sales with value greater than 0 and it will report on it. If you click on the 0 sales you should get the No Data message on PDF.
Is this what you need?
WF 8.1.05 Windows
December 21, 2007, 07:04 AM
<JG>Silly question, but why do you not make it a conditional drilldown?
That way there is never going to an issue.
TABLE FILE CAR
SUM
DEALER_COST
BY COUNTRY
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET STYLE *
TYPE=DATA,COLUMN=COUNTRY,
TARGET='_blank',
FOCEXEC=carinst(COUNTRY=N1),WHEN= DEALER_COST GT 10000,
$
ENDSTYLE
END
December 21, 2007, 12:12 PM
<GGOFAnalyst>I fixed the problem. The problem wasn't the format or how I was calling the &Line. The problem was that I wasn't using a where statement to specify my region.
Thanks everyone.