Focal Point
[CLOSED] Two report formats out of one procedure...

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

October 15, 2015, 09:06 AM
Trudy
[CLOSED] Two report formats out of one procedure...
Is there a way to have two report outputs from one procedure. I am converting reports from Oracles EPM to WF. In EPM there was the ability to run a query and produce multiple output types from the one query. You could schedule the query to run and send the various reports to certain users. I have been able to setup bursting reports in WF to different users. But this is slightly different in that I want to send a report that contains all the information to 2 users and then I want to send the same information for a subgroup to 2 users. Is there anyway to do this by only having to bring back the results twice from the data source?

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


WF8
Windows
October 15, 2015, 01:13 PM
j.gross
Here's one approach.

Your burst is on some field, say 'foo', defined as primary sort key of the report:

... BY FOO ...
Pull and hold your data. Then 'duplex' it so that every section is produced twice. You can then produce a report, bursting the result so that the first copy of all sections goes to one recipient, and the second copy to the other respective recipient.

code-sketch of the method:

Let's assume FOO is /A10.
define file hold
alpha/a11='a' | foo;
beta /a11='b' | foo;
end
match file hold
by alpha as xkey
by [each of the columns in HOLD]
run
file hold
by beta as xkey
by [each of the columns in HOLD]
after match hold as hold2 old-or-new
end

Then issue your report, with

... BY xkey NOPRINT
BY FOO ...

and burst on "xkey", with all a... values going to the full-report recipient, and each of the "b..." values going to the respective section recipients.


- Jack Gross
WF through 8.1.05
October 16, 2015, 03:56 PM
John_Edwards
I'll be honest, I'd recommend breaking this into two completely separate routines, and make two calls at the data.

You can do it in one shot, but maintenance on the unit could be one big pile of ugly a few years down the road for a new person or for you when you've forgotten how it works. Two simple routines is going to save your company money in the long run, 'cause CPU time is dirt cheap now.

J.

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



October 16, 2015, 05:07 PM
Doug
Two report procedures.
One Compound Report (Final Output).
Done in the Composer.
October 19, 2015, 11:37 AM
j.gross
I my approach above, on second thought, things can be simplified.

You'll still need a HOLD file with the data, but you can avoid the Match File; instead use McGuyver technique to duplex the records.

EX MAKESEQ FIRST=1,LAST=2
creates a Focus file FSEQ.FOC with two rows (COUNTER=1 and 2) - search the forum for "MAKESEQ.FEX" to locate the source code I posted long ago.

Use a "conditional" join (of the HOLD file to the FSEQ file) with no condition, to generate a Cartesian product, in effect duplicating each HOLD record.

If "SORT_KEY" is the original bursting key, define (against the join structure)
BURST_KEY/... =
IF COUNTER EQ 1 THEN SORT_KEY
ELSE [a designated value, perhaps "*" or zero, outside the domain of SORT_KEY values];

If you construct and style your report with
BY BURST_KEY NOPRINT
BY SORT_KEY ...

and distribute it bursting on BURST_KEY (instead of SORT_KEY), with the full-report recipient receiving "*" and others receiving their respective SORT_KEY value, you'll have the effect you need.

The list maintenance burden with respect to the partial report recipients is unchanged, and w/r/t the full-report recipients is a one-time adjustment.