September 28, 2007, 02:51 PM
ETYou can also try to run the report for both years and do a page break for each year.
Just a suggestion.
Good luck
et
September 28, 2007, 02:53 PM
susannahare you in PDF or HTML or EXCEL
and please update your signature so we know what version/platform you're on.
are you familiar with the concept of LOOPs?
you'll set your year as an &variable
and execute your single set of code 2 times,
here is a simple example
-SET &YEAR = 2006 ;
-toploop
TABLE FILE ...
IF YEAR IS &YEAR
ON TABLE HOLD AS MYTAB&KOUNTER FORMAT HTMTABLE
END
-RUN
-IF &YEAR IS 2007 GOTO done;
-SET &YEAR = 2007 ;
-GOTO toploop;
-done
-HTMLFORM BEGIN
!IBI.FIL.MYTAB0;
!IBI.FIL.MYTAB1;
-HTMLFORM END
For PDF or EXCEL , you'll need to do what Prarie says, go read up on Compound Reports.
or..do what ET says, alot simpler!
October 01, 2007, 09:41 AM
PBrightwellI'm not sure what you are wanting to accomplish. If you want your report to be:
Sales for 2007
England $$$$
Italy $$$$
Sales for 2006
England $$$$
Italy $$$$
then using a compound report or a loop will work. Simply add ON TABLE SET COMPOUND OPEN to the first report and ON TABLE SET COMPOUND CLOSE to the last.
However, if what you are wanting is:
Sales for 2007 Sales for 2006
Endland $$$$ $$$$
Italy $$$$ $$$$
then if the data for both years is in the same file, extract both years and use ACROSS sales year. If the data is in different files, extract each year's data and use MATCH to put the files together.
October 01, 2007, 10:14 AM
GamPOf course it is also quite possible that you need to create one report out of two different files. If that is the case, you may be able to do something like this:
APP FI TEST DISK GamP/TEST.FTM
TABLE FILE CAR
PRINT CAR BODY MODEL SEATS SALES
BY COUNTRY
IF COUNTRY EQ 'ENGLAND'
ON TABLE HOLD FORMAT ALPHA AS TEST
END
APP FI TEST DISK GamP/TEST.FTM (APPEND
TABLE FILE CAR
PRINT CAR BODY MODEL SEATS SALES
BY COUNTRY
IF COUNTRY EQ 'ITALY'
ON TABLE HOLD FORMAT ALPHA AS TEST
END
TABLE FILE TEST PRINT *
END
As long as the output of the two different reports is exactly the same in terms of lengths of the columns, this will work, also allowing for a change of sort fields and such.
Hope this helps.
GamP