Focal Point
[SOLVED] PDF Report, TabHeading, Text, Wrap, Won't do it.

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

March 12, 2012, 05:09 PM
John_Edwards
[SOLVED] PDF Report, TabHeading, Text, Wrap, Won't do it.
I have the following in my stylesheet for a pdf report:

TYPE=TABHEADING,
LINE=17,
OBJECT=TEXT,
SIZE=14,
WRAP=2.875000,
$

Everything I've read here and in the help files indicates that the above code with a -SET WRAP=ON should do the trick, but it refuses to do what I'm telling it to. Is there some secret sauce I'm missing for this? I've played around quite a bit and I just don't seem to get any change to the output -- my text just runs off the end of the page.

Note that I'm using the size=14 to make sure I'm working on the correct line. That command is working correctly.

7.6.11 on NT.

J.

This message has been edited. Last edited by: John_Edwards,



March 12, 2012, 05:46 PM
Waz
Put your text into a field, and wrap that, it should work.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

March 12, 2012, 05:58 PM
John_Edwards
That may be out of reach because I'm offering the user about two dozen sentences to be included in a letter, and they can choose any or all of them. With an amper variable I can use FOC_NONE to keep the letter from having a bunch of blank lines. If I put the material into a field I get a bunch of blank lines that make the letter too long.

S.



March 12, 2012, 06:20 PM
Waz
How large are your sentences ?

DEFINE FILE CAR
 LONG_LINE1/A1000 = 'EDA, EDA/SQL, FIDEL, FOCCALC, FOCUS, FOCUS Fusion, FOCUS Vision, Hospital-Trac, Information Builders, the '
                  | 'Information Builders logo, Parlay, PC/FOCUS, SmartMart, SmartMode, SNAPpack, TableTalk, WALDO, Web390, '
                  | 'WebFOCUS and WorldMART are registered trademarks, and iWay and iWay Software are trademarks of Information '
                  | 'Builders, Inc.' ;
 LONG_LINE2/A1000 = 'Due to the nature of this material, this document refers to numerous hardware and software products by their '
                  | 'trademarks. In most, if not all cases, these designations are claimed as trademarks or registered trademarks by '
                  | 'their respective companies. It is not this publisher’s intent to use any of these names generically. The reader is '
                  | 'therefore cautioned to investigate all claimed trademark rights before using any of these names other than to refer '
                  | 'to the product described.' ;
 LONG_LINE3/A1000 = 'Copyright © 2006, by Information Builders, Inc and iWay Software. All rights reserved. Patent Pending. This manual, '
                  | 'or parts thereof, may not be reproduced in any form without the written permission of Information Builders, Inc. ; ' ;
 LONG_LINE4/A1000 = 'Do you have questions about WebFOCUS?' ;
 LONG_LINE5/A1000 = 'Call Information Builders Customer Support Service (CSS) at (800) 736-6130 or '
                  | '(212) 736-6130. Customer Support Consultants are available Monday through Friday '
                  | 'between 8:00 a.m. and 8:00 p.m. EST to address all your WebFOCUS questions. '
                  | 'Information Builders consultants can also give you general guidance regarding product '
                  | 'capabilities and documentation. Please be ready to provide your six-digit site code (xxxx.xx) '
                  | 'when you call.' ;
 LONG_LINE6/A1000 = 'You can also access support services electronically, 24 hours a day, with InfoResponse '
                  | 'Online. InfoResponse Online is accessible through our World Wide Web site, '
                  | 'http://www.informationbuilders.com. It connects you to the tracking system and '
                  | 'known-problem database at the Information Builders support center. Registered users can '
                  | 'open, update, and view the status of cases in the tracking system and read descriptions '
                  | 'of reported software issues. New users can register immediately for this service. The '
                  | 'technical support section of www.informationbuilders.com also provides usage '
                  | 'techniques, diagnostic tips, and answers to frequently asked questions. '
                  | 'To learn about the full range of available support services, ask your Information Builders '
                  | 'representative about InfoResponse Online, or call (800) 969-INFO. ' ;

END
TABLE FILE CAR
HEADING
"<LONG_LINE1"
"<LONG_LINE2"
"<LONG_LINE3"
" "
"<LONG_LINE4"
"<LONG_LINE5"
"<LONG_LINE6"
 SUM COUNTRY NOPRINT
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
UNITS=CM, PAGESIZE='A4', LEFTMARGIN=0.635000, RIGHTMARGIN=0.635000,
    TOPMARGIN=0.635000, BOTTOMMARGIN=0.635000, SQUEEZE=ON,
    ORIENTATION=LANDSCAPE, $
TYPE=REPORT, GRID=OFF, FONT=TIMES NEW ROMAN, $
TYPE=HEADING, ITEM=1, OBJECT=FIELD, WRAP=28, $
ENDSTYLE
END


Depending on your version of WebFOCUS, you could even use MARKUP=ON

DEFINE FILE CAR
XX/A1000 = '<full><b>' | COUNTRY | 'Fully Justified Heading:</b> Customer'
| ' Service Is Everything. At Information Builders, we are as open and flexible as'
| ' our software, and our customers are our greatest asset. For every new product'
| ' and feature, there''s a customer who drove it. For every customer there''s an'
| ' answer. Our customer-centric philosophy is backed up by an integrated support'
| ' network of people passionately dedicated to the success of your business'
| ' initiatives. Consulting, Education, Technical Support, Product Development the'
| ' support network is the sum of these groups, and it stands ready to help you.'
| ' Information Builders has also created a community Web site for our developers.'
| ' At Focal Point, you can visit our message boards and browse through numerous'
| ' helpful resources.</full>';
END
TABLE FILE CAR
BY COUNTRY NOPRINT PAGE-BREAK
HEADING
"<XX"
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET NEWLAYOUT ON
ON TABLE SET PAGE-NUM OFF
ON TABLE SET STYLE *
type=report, font=courier, size=10, $
type=datamatrix, position=(0 0), dimension=(5 3), $
type=heading, position=(1 2), dimension=(7 1.8), markup=on, wrap=on, $
END

This message has been edited. Last edited by: Waz,


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

March 13, 2012, 10:45 AM
John_Edwards
Neither one of these appear to address one of my issues -- I need empty strings to disappear from the report. In order for that to happen I need to wrap text. I have 100 potential lines from which the end user will select one to four for inclusion in the letter, and I need the rest to disappear. I can do this with FOC_NONE if it's text, but not if it's fields.

Is it possible to wrap text in a TABHEADING?

J.



March 13, 2012, 11:16 AM
j.gross
Just combine (catenate) the selected boilerplate elements into a single alpha variable, and imbed that one (like Waz's XX) in the report heading.


- Jack Gross
WF through 8.1.05
March 13, 2012, 11:26 AM
John_Edwards
It's a bullet list, so that's going to be painful as well. If I could embed a CR/LF in the string it wouldn't be so bad -- anyone know how to do that?

Wrapping text should have been a feature in 4.3.5. This is really a stupid oversight.

J.



March 13, 2012, 12:00 PM
j.gross
Use dalog manager switches to turn the heading lines on and off.

Building on Waz's sample code, this turns them on/off randomly, to simulate variable user selections.

APP PREPENDPATH IBISAMP

DEFINE FILE CAR
 LONG_LINE1/A1000 = '[1] EDA, EDA/SQL, FIDEL, FOCCALC, FOCUS, FOCUS Fusion, FOCUS Vision, Hospital-Trac, Information Builders, the '
                  | 'Information Builders logo, Parlay, PC/FOCUS, SmartMart, SmartMode, SNAPpack, TableTalk, WALDO, Web390, '
                  | 'WebFOCUS and WorldMART are registered trademarks, and iWay and iWay Software are trademarks of Information '
                  | 'Builders, Inc.' ;
 LONG_LINE2/A1000 = '[2] Due to the nature of this material, this document refers to numerous hardware and software products by their '
                  | 'trademarks. In most, if not all cases, these designations are claimed as trademarks or registered trademarks by '
                  | 'their respective companies. It is not this publisher’s intent to use any of these names generically. The reader is '
                  | 'therefore cautioned to investigate all claimed trademark rights before using any of these names other than to refer '
                  | 'to the product described.' ;
 LONG_LINE3/A1000 = '[3] Copyright © 2006, by Information Builders, Inc and iWay Software. All rights reserved. Patent Pending. This manual, '
                  | 'or parts thereof, may not be reproduced in any form without the written permission of Information Builders, Inc. ; ' ;
 LONG_LINE4/A1000 = '[4] Do you have questions about WebFOCUS?' ;
 LONG_LINE5/A1000 = '[5] Call Information Builders Customer Support Service (CSS) at (800) 736-6130 or '
                  | '(212) 736-6130. Customer Support Consultants are available Monday through Friday '
                  | 'between 8:00 a.m. and 8:00 p.m. EST to address all your WebFOCUS questions. '
                  | 'Information Builders consultants can also give you general guidance regarding product '
                  | 'capabilities and documentation. Please be ready to provide your six-digit site code (xxxx.xx) '
                  | 'when you call.' ;
 LONG_LINE6/A1000 = '[6] You can also access support services electronically, 24 hours a day, with InfoResponse '
                  | 'Online. InfoResponse Online is accessible through our World Wide Web site, '
                  | 'http://www.informationbuilders.com. It connects you to the tracking system and '
                  | 'known-problem database at the Information Builders support center. Registered users can '
                  | 'open, update, and view the status of cases in the tracking system and read descriptions '
                  | 'of reported software issues. New users can register immediately for this service. The '
                  | 'technical support section of www.informationbuilders.com also provides usage '
                  | 'techniques, diagnostic tips, and answers to frequently asked questions. '
                  | 'To learn about the full range of available support services, ask your Information Builders '
                  | 'representative about InfoResponse Online, or call (800) 969-INFO. ' ;

END
-REPEAT NX.J FOR &J FROM 1 TO 6 ;
-SET &R.&J=INT(RDUNIF('D2')+.5);
-SET &Z.&J=IF (&R.&J) THEN ' ' ELSE '-*';
-NX.J

TABLE FILE CAR
HEADING
&Z1.EVAL "<LONG_LINE1"
&Z2.EVAL "<LONG_LINE2"
&Z3.EVAL "<LONG_LINE3"
&Z4.EVAL "<LONG_LINE4"
&Z5.EVAL "<LONG_LINE5"
&Z6.EVAL "<LONG_LINE6"
FOOTING
"SELECTED: 1(&R1), 2(&R2), 3(&R3), 4(&R4), 5(&R5), 6(&R6)"
 SUM COUNTRY NOPRINT
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
UNITS=CM, PAGESIZE='A4', LEFTMARGIN=0.635000, RIGHTMARGIN=0.635000,
    TOPMARGIN=0.635000, BOTTOMMARGIN=0.635000, SQUEEZE=ON,
    ORIENTATION=LANDSCAPE, $
TYPE=REPORT, GRID=OFF, FONT=TIMES NEW ROMAN, $
TYPE=HEADING, ITEM=1, OBJECT=FIELD, WRAP=28, $
ENDSTYLE
END

This message has been edited. Last edited by: j.gross,
March 13, 2012, 12:41 PM
John_Edwards
HO! THAT is the secret to this.

Incoming text arrives in an amper variable. Default it to FOC_NONE just in case --

-DEFAULT &REASON_1 = 'FOC_NONE';


Create a kill switch for lines that aren't filled out --

-SET &KILL_LINE_1 = IF &REASON_1 EQ 'FOC_NONE' THEN 'FOC_NONE' ELSE ''; 


Create a field for the table you're reporting on --

REASON_1/A1000 = '&REASON_1'; 


Then include both the kill switch and the defined field in the HEADING/SUBHEAD/SUBFOOT/FOOTING --

TABLE FILE HOLD3
PRINT OUTPUT_FIELDS
ON TABLE SUBHEAD
"&KILL_LINE_1  <REASON_1"
ON TABLE PCHOLD FORMAT PDF
.
.
.
TYPE=TABHEADING,
     LINE=1,
     OBJECT=FIELD,
     ITEM=1,
     WRAP=6.8,
$
.
.
.
END


I was in the process of adjusting the lines in JavaScript which had ugly-as-**** written all over it. This is something that can be modified quickly and easily and the user interface code doesn't get crushed.

Thanks bud!

J.



March 13, 2012, 12:51 PM
j.gross
Close your [ code ].

TABLE FILE HOLD3
PRINT OUTPUT_FIELDS
ON TABLE SUBHEAD
"* &KILL_LINE_1 <REASON_1"
"* &KILL_LINE_2 <REASON_2"
"* &KILL_LINE_3 <REASON_3"
ON TABLE PCHOLD FORMAT PDF
END


Right -- GUI will tolerate &vars within the " ".
March 13, 2012, 05:20 PM
Waz
quote:
It's a bullet list


I read that line very differntly. Eeker


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

March 16, 2012, 09:32 AM
MAdams1
Also I've noticed that with PDF, having SET PRINTPLUS = ON helps.

Just sayin'


WebFOCUS Server 8.1.05
Windows 2008 Server
WebFOCUS AppStudio 8.1.05
Windows 7 Professional
IE 11 and Chrome Version 43.0.2357.124 m.
Mostly HTML, PDF, Excel, and AHTML