Focal Point
print "legend" in report footing

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

September 16, 2008, 03:14 PM
leo13
print "legend" in report footing
Hi,
I have a report with a 3-character code field. Rather than wasting space by printing the description with each row of the report (the description is 30 characters), I'd like to print the code on each row and then have a "legend" in the footing of the report that would print the various possible codes and descriptions. Is this possible? Is this really 2 different reports printing on the each page?

Any suggestions would be greatly appreciated.

WF 7.1.4 Production (should have WF 7.6.5 by mid-October)
Windows 2003


WebFOCUS 7.7.05
Windows 2008
September 16, 2008, 03:20 PM
GinnyJakes
How many codes do you have?

You could hard-code them or table them ahead of time then -READ them into indexed amper variables that you could put in the footing.

I'm sure that others have lots of different ideas.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
September 16, 2008, 03:22 PM
Francis Mariani
Why would this be two reports printing on each page? You can put your legend at the bottom of every page in the report using SUBFOOT or once, at the end of the report using ON TABLE SUBFOOT.


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
September 16, 2008, 03:41 PM
Darin Lee
The issue, as I understand it, it that Leo wants the legend to contain a list of descriptions for all codes that appear on the report. If you don't care whether or not the code appears in the report (just give a complete list) then FOOTING (not SUBFOOT) gives you the hard-coded list at the bottom of each page. If that list will vary, then Ginny's suggestion will probably be the easiest - it's not two reports, but it does require two passes at the data.


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
September 16, 2008, 03:58 PM
leo13
Hi,
I don't know how many codes there are (ok, this really isn't my report -- a user asked me how to do this) but I know we don't want to hard-code the values because they would change. And, yes, it doesn't matter whether or not the value is actually used in the report, because it could be. But we want the codes and the descriptions to be at the bottom of each page of the report. Can someone give me an example of using a -READ with indexed amper variables, or point me to a manual and page with an example? I've never used index amper variables.
Thanks!


WebFOCUS 7.7.05
Windows 2008
September 16, 2008, 04:49 PM
GinnyJakes
This needs a lot of work but I think you'll get the idea. Since I put two on a line, you'll have to make allowances for short lines. And you can get your codes and descriptions from a different file than your data. Also, you'll have to add styling for positioning.

-SET &ECHO=ALL;
TABLE FILE CENTORD
PRINT DST.PLANTLNG
BY PLANT
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE
END
-RUN
-SET &PLANT_CNTR=&LINES;
-SET &I=0;
-REPEAT DESCLOOP &PLANT_CNTR TIMES
-READ SAVE NOCLOSE &PLANT.A3. &PLANT_NAME.A11.
-IF &RETCODE EQ 0 GOTO DESCLOOP ;
-SET &I=&I+1;
-SET &PLANT.&I=&PLANT;
-SET &PLANT_NAME.&I=&PLANT_NAME;
-TYPE &I &PLANT.&I &PLANT_NAME.&I
-DESCLOOP 
TABLE FILE CENTORD
SUM LINE_COGS
BY PLANT PAGE-BREAK
BY STORE_CODE
BY ORDER_DATE
ON TABLE SET ONLINE-FMT PDF
FOOTING
-SET &I=0;
-SET &LOOPLIM=&PLANT_CNTR/2;
-REPEAT ENDFOOT &LOOPLIM TIMES
-SET &I=&I+1;
-SET &J=&I+1;
"&PLANT.&I &PLANT_NAME.&I &PLANT.&J &PLANT_NAME.&J"
-SET &I=&J;
-ENDFOOT
END



Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
September 17, 2008, 03:31 PM
leo13
Thanks, Ginny, that looks very helpful. I'll try it out and see how it goes.


WebFOCUS 7.7.05
Windows 2008