Focal Point
Dynamic Report Selection - launch page [SOLVED]

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

August 29, 2011, 06:22 PM
j42p11
Dynamic Report Selection - launch page [SOLVED]
First, I do not have Dev Studio here any my company, I am having to do this all by hand. I am building a launch page that I want to provide the users with the ability to run any combination of the 16 pre-defined report output options. There are several user prompted inputs and I can handle all those and pass them to the various reports. The problem that I am running into now is giving the users the ability to select any combination of the reports for the output as a compound report. The only output format needed is excel.

My initial attempt was having a multiple select list of the various reports and using DM for handling them with something like this:
-IF &RPTTYP.EXISTS NE 1 THEN GOTO ENDLOOP;
-INCLUDE '&RPTTYP'
-IF &RPTTYP0.EXISTS THEN GOTO NEXT_STEP ELSE GOTO ENDLOOP;
-NEXT_STEP
-REPEAT ENDLOOP FOR &COUNTER FROM 2 TO &RPTTYP0;
-INCLUDE '&RPTTYP.&COUNTER'
-ENDLOOP

This will give me the correct reports based on the user input, but I am not able to make this a compound report using the SET COMPOUND=OPEN/CLOSE command.

The code output that I would like to get for a user selecting 3 reports should be like the following:
SET COMPOUND=OPEN
-INCLUDE REPORT1
-INCLUDE REPORT2
SET COMPOUND=CLOSE
-INCLUDE REPORT3

I can get the SET COMPOUND=OPEN command by sticking it in the first part of the loop, but I cannot figure out how to get the SET COMPOUND=CLOSE in before the last report selected. I can trick the system by using a dummy ending report after the dynamic selection that will not return any output (leaving emptyreport off). However, I do not like this as a permanent solution. Anyone have any thoughts or approaches?

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


WebFocus 7.7.03 - 7703_hotfix - Gen: 284
Dev Studio 7.7.03 - Gen: 06062011
Mainframe Focus 7.7.03
Windows WF Client Server
zOS Reporting server (hub-sub config)
Windows Reporting server
Windows RC Client Server
August 29, 2011, 06:34 PM
Doug
First suggestion: Get Dev Studio... Your life will be so much easier... Wink
August 30, 2011, 02:22 AM
GamP
Well, you know how many reports to create - that's in &RPTTYP0. So, if you find in your repeat loop (keeping count of how far you progressed) that the just processed report is for counter &RPTTYP0 - 1, that's when you put in the compound close.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
August 30, 2011, 10:40 AM
j42p11
@Doug - I am trying, believe me.

@GamP - I will give that a shot. I am not the greatest with DM & loops but your suggestion is something that I had thought of. Guess I was thinking on the right track. Just need to work it a bit.

Thanks for the reply.


WebFocus 7.7.03 - 7703_hotfix - Gen: 284
Dev Studio 7.7.03 - Gen: 06062011
Mainframe Focus 7.7.03
Windows WF Client Server
zOS Reporting server (hub-sub config)
Windows Reporting server
Windows RC Client Server
August 30, 2011, 12:08 PM
jfr99
Hi,

I create a report at the end that displays the parameters that were selected for each time the reports are launched. This did two things for me. One, it solved the problem you just described and two, it serves as a log for what was entered on the launch page. I don't know if this helps, but it worked for me.

Jim


WebFocus 8.201M, Windows, App Studio
August 30, 2011, 01:19 PM
j42p11
I was able to get GamP suggestion working by the following:

-IF &RPTTYP0.EXISTS THEN GOTO :NUMB ELSE :SKIP;
-:NUMB
-SET &RPTNO=&RPTTYP0-1;
-IF &RPTTYP.EXISTS NE 1 THEN GOTO ENDLOOP;
SET COMPOUND=OPEN
-INCLUDE '&RPTTYP'
-IF &RPTTYP0.EXISTS THEN GOTO NEXT_STEP ELSE GOTO ENDLOOP;
-NEXT_STEP
-REPEAT ENDLOOP FOR &COUNTER FROM 2 TO &RPTNO;
-INCLUDE '&RPTTYP.&COUNTER'
-ENDLOOP
SET COMPOUND=CLOSE
-INCLUDE '&RPTTYP.&RPTTYP0'

-EXIT
-:SKIP
-INCLUDE '&RPTTYP'
-EXIT


WebFocus 7.7.03 - 7703_hotfix - Gen: 284
Dev Studio 7.7.03 - Gen: 06062011
Mainframe Focus 7.7.03
Windows WF Client Server
zOS Reporting server (hub-sub config)
Windows Reporting server
Windows RC Client Server
August 30, 2011, 02:19 PM
Doug
Great Cool
quote:
I am trying, believe me.