Focal Point
IF GOTO

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

June 25, 2007, 01:16 PM
KK
IF GOTO
Hi,

Is there a workaround to do the following using IF THEN GOTO

IF &OUTPUT EQ 'HTML' THEN GOTO A1 and A2 and A3
ELSE IF &OUTPUT EQ 'EXL2K' THEN GOTO A1 and A3

A1,A2,A3 are the three labels for three reports in the procedure. I want to skip the graph if the output option is EXL2K. Please help.

Thank you,
KK


Test - Webfocus 7.6.7
Prod - Webfocus 7.6.7
Win2003
Sql Server 2000 and 2008
June 25, 2007, 02:52 PM
Francis Mariani
I would have this:

-A1
blah
blah
blah

-A2
-IF &OUTPUT EQ 'EXL2K' GOTO A3;
blah
blah
blah

-A3
blah
blah
blah


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
June 25, 2007, 03:35 PM
KK
Francis,
I tried your approach but its just displaying the third report. Its skipping the first two reports for all the formats.

Is there any other approach or do you think I am missing something.

Thank you,
KK


Test - Webfocus 7.6.7
Prod - Webfocus 7.6.7
Win2003
Sql Server 2000 and 2008
June 25, 2007, 03:49 PM
Francis Mariani
This sounds like a compound report, are you using the compound report syntax to OPEN the compound report, create the reports and then before the last report, CLOSE the compound report?


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
June 25, 2007, 03:54 PM
KK
No this is not a compound report. This is a regular report with 3 fexs (2 reports and 1 graph).

Thanks,
KK.


Test - Webfocus 7.6.7
Prod - Webfocus 7.6.7
Win2003
Sql Server 2000 and 2008
June 25, 2007, 03:59 PM
Prarie
If you want it to run more than 1 fex..then it becomes a compound report.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
As Francis suggested but missed the -RUN command i.e.


-A1
blah
blah
blah
-RUN

-A2
-IF &OUTPUT EQ 'EXL2K' GOTO A3;
blah
blah
blah
-RUN

-A3
blah
blah
blah



Hope this works for you...

Allan


Webfocus 4.3.6
Windows XP
Reporting against Oracle Data and various Mainframe data (Adabas etc), ODBC to Excel/Access etc.
Good catch Allan! I usually never forget the -RUN statement, even in a non-working example.


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
Unless you use the SET COMPOUND=(OPEN/CLOSE) syntax, your code cannot create more than one report in excel format. Should work OK with HTML. Try using -SET &ECHO=ALL; and then view source to set what exactly is being run.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
Francis, Allan,

I would love to know what difference a -RUN will make to this process.


Alan.
WF 7.705/8.007
Thank you all for your suggestions. Allan I already added -RUN but whats happening is, if the output format is HTML it runs A1 and A3 reports but when I change it EXL2K or PDF, it runs only the first report A1.

Please advise.

Thanks,
KK


Test - Webfocus 7.6.7
Prod - Webfocus 7.6.7
Win2003
Sql Server 2000 and 2008
Have you Added the Compound report info as mentioned?


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
SET COMPOUND = OPEN
-RUN

-A1
blah
blah
blah
-RUN

-A2
-IF &OUTPUT EQ 'EXL2K' GOTO A3;
blah
blah
blah
-RUN

-A3
SET COMPOUND = CLOSE
-RUN

blah
blah
blah
-RUN



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
OK - Alan B you were correct the -RUN makes no real differnce. That annoyed me so I had to solve it with a sample.

KK as a few post allude to you need to be clear if you want a compound report or three different reports. I have solved for three different reports (at least it works in 4.3.6) see code below.

If &OUTPUT is anything but EXCEL then the HTML report will run, and all reports are in HTML format. If set to EXCEL as below than the first and last procedures will run in excel format.

This may (or may not!) solve your problem.

If you are after a compound report I will see what I can do.


Allan



-* File CAR.FEX

-SET &OUTPUT = 'EXCEL';
-SET &OUTPUTTYPE = IF &OUTPUT EQ 'EXCEL' THEN 'ON TABLE SET ONLINE-FMT EXL2K'
-ELSE 'ON TABLE SET ONLINE-FMT HTML';


TABLE FILE CAR
SUM CNT.CAR
BY COUNTRY

&OUTPUTTYPE.EVAL

END

-IF &OUTPUT EQ 'EXCEL' THEN GOTO SKIPHTML

TABLE FILE CAR
SUM CNT.MODEL
BY CAR

ON TABLE SET ONLINE-FMT HTML

END

-SKIPHTML

TABLE FILE CAR
SUM AVE.RETAIL_COST
BY COUNTRY

&OUTPUTTYPE.EVAL

END


Webfocus 4.3.6
Windows XP
Reporting against Oracle Data and various Mainframe data (Adabas etc), ODBC to Excel/Access etc.
Darin,

You are right ! I used the compound report syntax and it perfectly.

Thank you everyone for your great and valuable suggestions.

KK.


Test - Webfocus 7.6.7
Prod - Webfocus 7.6.7
Win2003
Sql Server 2000 and 2008