January 13, 2009, 01:15 PM
ChannySListing values as multiple lines in the heading
I have the following report:
TABLE FILE CAR
PRINT CAR
WHERE COUNTRY NE 'JAPAN'
END
I would like to be able to have the countries that were used in the reported listed each on a separate row in the heading. I know that I could pass through the data two times and generate the list with HTML
tags that would force the issue in HTML but what about for PDF, EXCEL etc.
Any ideas of how best to do this?
January 13, 2009, 01:52 PM
j.grossRather than passing thru the data source twice, use HOLD. -- Use two verbs and "hold format focus", to isolate one record per key value in the upper segment, and the rest of your data (if you will list more than one record per key) in the lower segment.
Can you take it from there?
January 13, 2009, 01:57 PM
FrankDutchChanny
There are a lot of ways to do this.
This is one....
SET HOLDLIST=PRINTONLY
DEFINE FILE CAR
CLINE/A25 WITH COUNTRY='"'||COUNTRY||'"';
TABLE FILE CAR
PRINT CLINE
WHERE COUNTRY NE 'JAPAN'
ON TABLE HOLD AS COUNTRIES
END
-RUN
TABLE FILE CAR
PRINT CAR
HEADING
-INCLUDE COUNTRIES.FTM
WHERE COUNTRY NE 'JAPAN'
END
I did not test this (I'm not at the office), it is just an idea that came up.
January 13, 2009, 02:56 PM
ChannySThanks for both of your ideas. Jack - I didn't get to test yours yet. I did test Frank's - needed minor code changes (posted below). It works well I'm just wondering how I can make use of this in an alignment grid which I'd like to use in the heading.
Modified working code:
SET HOLDLIST=PRINTONLY
DEFINE FILE CAR
CLINE/A25 WITH COUNTRY='"'||COUNTRY||'"'
END
TABLE FILE CAR
PRINT CLINE
WHERE COUNTRY NE 'JAPAN'
ON TABLE HOLD AS COUNTRIES
END
-RUN
TABLE FILE CAR
PRINT
'CAR.COMP.CAR'
HEADING
-INCLUDE COUNTRIES
END
January 13, 2009, 03:38 PM
FrankDutchNice to see that this works.....
Your additional question is a bit more complex. but why do you need a grid if you have each value on one line?
You can create the code lines for the grid more or less in the same way and include them.
January 13, 2009, 05:00 PM
ChannySI wanted the grid because these countries are really just one cell in the grid - there is alot of other stuff I need to print out and align in the heading.