Focal Point
How can Report Caster send no report if no data?

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

December 19, 2006, 06:58 AM
mark66
How can Report Caster send no report if no data?
Hi,

I have a report that rarely contains data, but that is emailed daily to users. They have requested that they only want to receive the report if it contains data.

At present they receive an Excel document with just the headings present.

Any pointers would be really appreciated.

Thanks

Mark.


WebFocus 765. iSeries v5r4
December 19, 2006, 07:17 AM
S.J. Kadish
Put in some code:

IF &RECORDS EQ 0 GO TO SOMELABEL
-SOMELABEL
-INCLUDE NADAMSG (a focexec with imbedded HTML saying there is no data for the day)

I'll send an example to you.


Sandy Kadish
Dev: 8.2.04- PostgreSQL
Test: 8.2.04 - PostgreSQL
Prod: 8.2.04 - PostgreSQL
December 19, 2006, 07:43 AM
Tony A
Mark,

I suppose you could insert a pre-processing fex to check the number of records that the report would contain and thne exit focus if the return is zero records. I can't remember whether the pre-processing fex can abort the process, but it's worth trying to see.

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 
December 19, 2006, 09:27 AM
Francis Mariani
Mark, Tony,

Used in conjunction with the &&KILL_RPC variable, this is exactly what the Pre-Process fex can be used for - to verify that the main report fex should run or not.

Look for KILL_RPC in the online docs.

Cheers,


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 19, 2006, 09:50 AM
Tony A
Thanks Francis, I knew there was something. It just needed the grey cells to work though - and they're not fully working at the moment Frowner

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 
December 19, 2006, 10:34 AM
Francis Mariani
The Guinness isn't helping? Wink


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 19, 2006, 10:50 AM
Tony A
That will be the reason then, I haven't had any since Friday 8th!
December 19, 2006, 11:06 AM
BlueZone
Mark :
As long as the final TABLE FILE step that creates the Excel-sheet is being executed, you will keep receiving an empty-sheet attached email.

If it is the only step in your fex, then try putting in another step prior to it that writes to a Hold file. If (&RECORDS = 0) on that step, then -EXIT else, execute the Excel creating step.

And Francis,
I am not sure if we have to tweak something in the way we use the pre-processing routine to NOT get an error email. The way we have it, FOCUS treats the execution of KILL_RPC as an error and sends out an email to recepients on the "NOTIFY ON ERROR" list. Of course, it is usually the programming staff here and no email is sent to the end-users. Is this something that we can supress and not be bothered with those un-necessary emails ?

Thank you,
Sandeep Mamidenna


-------------------------------------------------------------------------------------------------
Blue Cross & Blue Shield of MS
WF.76-10 on (WS2003 + WebSphere) / EDA on z/OS + DB2 + MS-SQL
MRE, BID, Dev. Studio, Self-Service apps & a dash of fun !! Music
December 19, 2006, 12:33 PM
Francis Mariani
Sandeep,

Read this thread, Susannah has a suggestion that might avoid the email message:

https://forums.informationbuilders.com/eve/forums/a/tpc/...171028331#5171028331

As well, the message only gets sent to the Report Caster Administrator, so it shouldn't be a real problem.

Cheers,


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 19, 2006, 03:53 PM
BlueZone
Thanks so much for your note Francis.

Goooooooooooooooood day !!
Sandeep Mamidenna


-------------------------------------------------------------------------------------------------
Blue Cross & Blue Shield of MS
WF.76-10 on (WS2003 + WebSphere) / EDA on z/OS + DB2 + MS-SQL
MRE, BID, Dev. Studio, Self-Service apps & a dash of fun !! Music
December 20, 2006, 01:26 PM
mark66
Thanks for all the suggestions everyone!

I thought I would give Susannah's method a try, in the post that Francis found (thanks Francis):

https://forums.informationbuilders.com/eve/forums/a/tpc/...171028331#5171028331

easier....
Do your Fex in 2 steps.
1) create the exact hold file from which the report would be created.
2) test the &LINES variable for value
if &LINES EQ 0 GOTO ENDOFJOB;
3) table file hold
write your nice report

This is easy and works like a charm. I do it 8zillion times a day. If there is no data, the fex bypasses the nice fancy html report generator; If there is no html output, the RC log will show NO REPORT TO DISTRIBUTE and nothing goes to anybody.
ok ok...it was 3 steps.


This works fine, apart from now myself and another developer get a failure message, as we are the Report Caster Administrators. The only options for the receipt of email are NEVER/ALWAYS/ON ERROR and I guess this is treated as 'ON ERROR'?

It would be great if I could find a way to turn the error flag off in this case, as we would still want to receive notification if the report has genuinely failed, but not if it is just empty!

Thanks

Mark


WebFocus 765. iSeries v5r4
December 25, 2006, 06:37 PM
Piipster
This sounds like an opportunity to use an alert. Check out the manuals for that.


ttfn, kp


Access to most releases from R52x, on multiple platforms.