I'm new to FML and I have two questions: 1. Is there a way to dynamically create an FML hierarchy from a HOLD file? 2. How do I print the entire hierarchy without having to specify the tags? ie, I want to print the entire CENTGL using the GET/WITH CHILDREN ALL, but I don't want to specify the 1000 account. Is there a way to do this? Do I have to have a top-most level parent defined?This message has been edited. Last edited by: Kerry,
Thanks.
Mark WF 7.6 Windows
December 10, 2008, 05:44 PM
FrankDutch
1) Depends on the hold file. What field do you have in it?
2) If you have the master for the FML created you can get all the accounts. Did you try what you suggested?
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
December 10, 2008, 09:26 PM
Waz
What I've done in the past to handle this is to TABLE the file getting all Children without parents, and build the FOR statements, HOLD it and INCLUDE it in the FML request.
e.g.
APP PATH IBINCCEN
TABLE FILE CENTGL
PRINT GL_ACCOUNT
COMPUTE
H_TEXT/A20 = ' WITH CHILDREN ALL' ;
WHERE GL_ACCOUNT_PARENT EQ ' '
ON TABLE HOLD AS HLD_FOR FORMAT ALPHA
END
-RUN
TABLE FILE CENTGL
PRINT
GL_ACCOUNT_TYPE
GL_ROLLUP_OP
GL_ACCOUNT_LEVEL
FOR GL_ACCOUNT
-INCLUDE HLD_FOR
ON TABLE PCHOLD FORMAT DHTML
END
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
December 11, 2008, 12:11 AM
MacLonghorn
Waz, pretty cool. I think that would work nicely. I'll try something along those lines.
Thanks.
Mark WF 7.6 Windows
December 11, 2008, 12:05 PM
MacLonghorn
OK, after looking at this, I don't think FML is what I really need. Ultimately, what I'm trying to do is:
TABLE FILE LEDGER
SUM
AMOUNT
BY ACCOUNT
BY YEAR ROWS 1985 OVER 1986
END
(Notice, no FML...ROWS/OVER are legit in tables w/o hierarchies) This works fine, but what I need is to add a final report total that shows the same thing:
TOTAL: 1985
1986
1987
Is that doable?
Thanks.
Mark WF 7.6 Windows
December 11, 2008, 12:25 PM
Darin Lee
Doable yes. Just depends on how you want it.
Two reports, one detail, one summary, one right after the other (or a compound report with NOBREAK) would do it.
You could also define a field for each year like
TOT1985/D16.2=IF YEAR EQ '1985' THEN AMOUNT ELSE 0; TOT1986/D16.2=IF YEAR EQ '1986' THEN AMOUNT ELSE 0; etc.
Then you could embed those field values in a table footing:
ON TABLE SUBFOOT "TOTAL: <5><TOT.TOT1985" "<5><TOT.TOT1986 " etc.
I was trying to come up with a multi-verb request, but you want the subtotals to ignore your first sort value and a multi-verb set requires all previous sort values to exist in subsequent verb phrases so that won't really work. Someone else might have a better idea - I'm sure there are several ways to do it.
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
December 11, 2008, 12:40 PM
GinnyJakes
Here's a psuedo-code version of something I did for one of my developers that might work for you. It involves, as Darin said, doing a summary and detail and a little sleight of hand, then MOREing them together.
SET ASNAMES=ON
DEFINE FILE LEDGER
TOTACCT/Ann='TOTAL';
SORTFLD/I2=2;
END
TABLE FILE LEDGER
SUM
AMOUNT
BY SORTFLD
BY TOTACCT AS ACCOUNT
BY YEAR
ON TABLE HOLD AS TOTACCT FORMAT ALPHA
ON TABLE SET HOLDLIST PRINTONLY
DEFINE FILE LEDGER
SORTFLD/I2=1;
END
TABLE FILE LEDGER
SUM
AMOUNT
BY SORTFLD NOPRINT
BY ACCOUNT
BY YEAR
MORE
FILE TOTACCT
END
Note that the TOTACCT field above must have the same format as the 'real' ACCOUNT field. Any you might have to hold the detail one more time.