Focal Point
Can use EX command within "TABLE...END" block?
July 13, 2012, 02:21 PM
gcarterITCan use EX command within "TABLE...END" block?
Hi,
Is it possible to use the EX command within a "TABLE...END" block?
Instead of
EX addReportInfo
TABLE
.
.
.
.
END
can I do
TABLE
.
.
.
EX addReportInfo
.
.
.
END
If so, where is the appropriate location for the EX command - after TABLE, after BY, after WHERE, after ON TABLE, etc?
I've tried without success.
Thanks,
George
WebFOCUS 7.6
Windows, All Outputs
July 13, 2012, 02:38 PM
Dan SatchellYou cannot use the EXEC command, but you can use -INCLUDE.
WebFOCUS 7.7.05
July 13, 2012, 03:29 PM
gcarterITThanks. I thought about that and I'm thinking the contents of the INCLUDEd file must follow the syntax at the location of the file it's included into, as if it was originally written as part of that file.
In other words, if I do this
TABLE...
PRINT...
EX addReportInfo
.
BY...
WHERE...
AND...
ON TABLE...
END
the INCLUDEd file, addReportInfo, can only have commands allowed between PRINT and BY - it cannot have a TABLE or WHERE command.
Does that sound correct?
Thanks,
George
WebFOCUS 7.6
Windows, All Outputs
July 13, 2012, 03:45 PM
Dan SatchellThe -INCLUDEd focexec can contain any of the commands allowed in a TABLE FILE request, including the TABLE FILE and END statements themselves. But after the parser has replaced the -INCLUDE with the statements in the focexec, the resulting code must be complete and proper.
WebFOCUS 7.7.05
July 13, 2012, 03:56 PM
gcarterITOk,
It sound like you're agreeing...
quote:
the INCLUDEd file must follow the syntax at the location of the file it's included into, as if it was originally written as part of that file.
In that case, I would need to rewrite the EX file to work properly as an INCLUDE file, resulting in 2 files, since the EX already works fine in other places. I need to research other alternatives.
Thanks,
George
WebFOCUS 7.6
Windows, All Outputs
July 13, 2012, 04:56 PM
Francis MarianiYou might like to tell us what you want to achieve with this program and the EX - perhaps a Dialog Manager loop is what you need...
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
July 16, 2012, 09:36 AM
gcarterITI have a report header generated through a .fex file specifically written for that purpose. for TABLE...END blocks generating a single report page, there is no issues - treat as a compound report, just run the EX first followed by the TABLE...END block. But I wish to use this same header for each page of a multi-page report generated using a TABLE...END bloc. That's why I was hoping I could stick the EX inside the TABLE...END block.
WebFOCUS 7.6
Windows, All Outputs
July 16, 2012, 11:58 AM
Darin LeeYou also might want to try executing the procedure first and writing the results (formatted contents of heading lines) out to a file. Then you can just -INCLUDE that file as Dan indicated.
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
July 16, 2012, 12:50 PM
gcarterITDarin:
Interesting.
I've always thought of INCLUDEing as inserting source code as if it was originally part of the recipient file. But it sound like you're saying the item to be INCLUDEd does not necessarily have to be source code (text), but as in my case, can be PDF output which is what my EX file produces. Am I understanding you correctly?
Thanks.
WebFOCUS 7.6
Windows, All Outputs
July 24, 2012, 06:13 AM
GamPWhat Darin tried to make clear, is that you can have parts of your table command generated beforehand, which can then be -INCLUDEd into you TABLE fex. Like (parts of) the heading, WHERE fields, style sheet lines and such.
Mind you, it all has to be plain readable code that fits into the curernt command syntax...
So your initial thought is correct: INCLUDEing is inserting source code as if it was originally part of the recipient file.
GamP
- Using AS 8.2.01 on Windows 10 - IE11. |
| in Focus since 1988 |