[SHARING] PDF Wrapping to the next line - not the next page
Hi all,
My first time on Focal Point as a subscriber but have used for many years to find solutions. So I thought I would try and pay back for all the help the community has given.
Anyway the issue that I faced was the ability to wrap columns to the next line in a PDF as opposed to the standard behavior which is to go to the next page.
The code uses FML to produce the desired result.
-SET &ECHO=ALL;
-* since the columns are selected, assume it's in a list somewhere either as variables, or in a file -* put into a file (I'm calling it columns.lst). TABLE FILE CAR BY SEATS ON TABLE SAVE AS COLS ON TABLE SET HOLDLIST PRINTONLY END
-*FILEDEF COLS DISK c:\work\columns.lst -RUN -* &NC is the number of columns that fit on a page -SET &NC = 2;
-SET &COL2='...'; -SET &LOOPCTR = 0;
-* read values in sets of &NC -COLREAD -SET &LOOPCTR = &LOOPCTR + 1; -*did we reach EOF on last read? -IF &COL2 EQ ' ' GOTO WRAP; -READ COLS,&COL1
-SET &OPEN = IF &LOOPCTR EQ 1 THEN 'OPEN' ELSE ' '; DEFINE FILE CAR CONTINENT/A10 = IF COUNTRY EQ 'JAPAN' THEN 'ASIA' ELSE 'EUROPE'; END TABLE FILE CAR SUM CAR.BODY.DEALER_COST CAR.BODY.RETAIL_COST CAR.BODY.SEATS -*BY CONTINENT ACROSS CAR.BODY.SEATS FOR CAR.ORIGIN.COUNTRY ENGLAND OVER FRANCE OVER ITALY OVER JAPAN OVER 'W GERMANY' WHERE SEATS EQ &COL1 &COL2 ON TABLE SET ASNAMES ON ON TABLE PCHOLD FORMAT PDF &OPEN NOBREAK -*ON TABLE HOLD FORMAT PDF ON TABLE SET PAGE-NUM NOLEAD ON TABLE SET ASNAMES ON ON TABLE SET BYDISPLAY ON ON TABLE SET BYPANEL ON ON TABLE NOTOTAL ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * INCLUDE = IBFS:/FILE/IBI_HTML_DIR/ibi_themes/Warm.sty, $ TYPE=ACROSSVALUE, BACKCOLOR='NONE', JUSTIFY=LEFT, $ ENDSTYLE END
-GOTO COLREAD
-WRAP -* dummy table to close everything TABLE FILE CAR PRINT COMPUTE X/A1='.'; AS '' BY COUNTRY NOPRINT IF RECORDLIMIT EQ 1 ON TABLE SET DROPBLNKLINE ON ON TABLE PCHOLD FORMAT PDF CLOSE ON TABLE SET STYLE * TYPE=DATA, SIZE=1,COLOR=WHITE,$ ENDSTYLE ENDThis message has been edited. Last edited by: FP Mod Chuck,
WebFOCUS 8203M O/S Windows 7
August 04, 2017, 02:35 PM
MartinY
MAK, since this is not a question and that you're sharing a trick with us, I suggest that you edit your post and add [SHARING] at the beginning of the subject.
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
August 04, 2017, 03:41 PM
FP Mod Chuck
MAK
That is awesome that your first post is helping others.. Keep them coming!
Thank you for using Focal Point!
Chuck Wolff - Focal Point Moderator WebFOCUS 7x and 8x, Windows, Linux All output Formats