Focal Point
[CLOSED] WRAPPING Long text in footing

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

January 13, 2020, 06:37 AM
Gowtham
[CLOSED] WRAPPING Long text in footing
Hi,

I am having A3000 length field which needs to be shown in footing .when we have this long dynamic field in footing its not working .But Same long text field is working in TABFOOTING.

-SET &FOOT_TEXT = 'At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, *** soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.';

TABLE FILE CAR
SUM
COMPUTE FOOT_TEXT/A1200 = '&FOOT_TEXT'; NOPRINT
SALES
BY COUNTRY
BY CAR
BY MODEL

FOOTING
" "
"<FOOT_TEXT"

ON TABLE SUBFOOT
" "
"<FOOT_TEXT"

ON TABLE PCHOLD FORMAT PDF

ON TABLE SET STYLE *
 UNITS=IN,
     PAGESIZE='Letter',
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
     MARKUP=ON,
$
TYPE=REPORT, FONT=ARIAL, SIZE=10, $
TYPE=TABFOOTING, SIZE=8, WRAP=10,COLOR=BLUE , $
TYPE=FOOTING, SIZE=8, WRAP=10,COLOR=RED, $

END
-RUN



WF- 8105
OUTPUT FORMAT- PDF

This message has been edited. Last edited by: FP Mod Chuck,
January 13, 2020, 07:14 AM
Tony A
Remember the documentation.

The WRAP syntax hasn't changed in recent releases so the following link should help you - WRAP Doc

You will learn that there are only certain TYPEs that can contain WRAP syntax.

General rule if you intend to hand code everything and bypass using the GUI - learn from the documentation and check it always when you have an issue to make sure you are following documented syntax.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
January 13, 2020, 01:04 PM
Gowtham
If WRAP is not way to show long dynamic
text field in page footing is there any alternative way is there. I know we can chunk long text into multiple lines using substring but this will be fine if the text is static.
January 17, 2020, 05:43 AM
Tony A
Are you using a variable to provide the footing text?

If so then you could use dialogue manager to split the text into separate variables.

The next question would be, are you using the text editor to code or the GUI?

If using the text editor then you could include dialogue manager to add as many lines of footing as you need to include all of the variables that you've split the original into.

Of course, if you're using the GUI to build the report then you cannot have dialogue manager so you are back to square one.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
January 21, 2020, 07:08 AM
Gowtham
Hi Tony, Value for footing will come from one of the table column .To demonstrate i have hard coded
values in Set variable .
January 22, 2020, 03:32 PM
vaayu
What is the format of your memo field? If its TX or something, change it to A1000 or so in the .mas file and try it again.


-********************
Sandbox: 8206.10
Dev: 8201M
Prod:8009
-********************
February 25, 2020, 01:22 PM
Gowtham
Actual format of the field is A3000. When I am trying to display that entire content in footing it's not working. Only 100 to 200 characters only displaying in the footing.
February 26, 2020, 04:44 AM
Tony A
If you understood the documentation, FOOTING is not supported with WRAP so you have to do something different.

Time to get the thinking cap on!

You can redefine text input using the PARAG function (look it up!), which will allow you to substitute a delimiter character with one of your choosing in order to split the single line of text into a potential paragraph.

I did think that, maybe, substituting a carriage return and then using LINEBREAK=CR, $ in the style sheet might have worked. But it doesn't for a FOOTING Frowner

So I decided to split the text into multiple lines within a temporary FOCUS file and then join that back into the final report.

A couple of things to take into account -


So, I replace the existing commas with the tilde character, PARAG the text into chunks up to 160 chars long, feed the result into a FREEFORM MODIFY and change the tildes back to commas on insertion.

Finally I join the temporary FOCUS table into the parent reporting table and add the footing lines to the footer. Interesting exercise to get the grey cells working Smiler

-SET &FOOT_TEXT = 'At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, *** soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.';
-SET &FOOT_TEXT = STRREP(&FOOT_TEXT.LENGTH, &FOOT_TEXT.QUOTEDSTRING, 1, ',', 1, '~', 1200, 'A1200');
-SET &TEMPTEXT = 'x,' | PARAG(1200, &FOOT_TEXT.QUOTEDSTRING, ',', 160, 'A160');

EX -LINES * EDAPUT MASTER,TEMPDAT1,C,MEM
FILENAME=TEMPDAT1, SUFFIX=FOC
  SEGNAME=SEG01, SEGTYPE=S1
    FIELDNAME=DUMMY, ALIAS=DUMMY, USAGE=A1, ACTUAL=A1, FIELDTYPE=I, $
    FIELDNAME=FOOT_TEXT01, ALIAS=FOOT_TEXT01, USAGE=A160, ACTUAL=A160, $
    FIELDNAME=FOOT_TEXT02, ALIAS=FOOT_TEXT02, USAGE=A160, ACTUAL=A160, $
    FIELDNAME=FOOT_TEXT03, ALIAS=FOOT_TEXT03, USAGE=A160, ACTUAL=A160, $
    FIELDNAME=FOOT_TEXT04, ALIAS=FOOT_TEXT04, USAGE=A160, ACTUAL=A160, $
    FIELDNAME=FOOT_TEXT05, ALIAS=FOOT_TEXT05, USAGE=A160, ACTUAL=A160, $
    FIELDNAME=FOOT_TEXT06, ALIAS=FOOT_TEXT06, USAGE=A160, ACTUAL=A160, $
    FIELDNAME=FOOT_TEXT07, ALIAS=FOOT_TEXT07, USAGE=A160, ACTUAL=A160, $
    FIELDNAME=FOOT_TEXT08, ALIAS=FOOT_TEXT08, USAGE=A160, ACTUAL=A160, $
EDAPUT*

CREATE FILE TEMPDAT1
MODIFY FILE TEMPDAT1
FREEFORM DUMMY FOOT_TEXT01 FOOT_TEXT02 FOOT_TEXT03 FOOT_TEXT04 FOOT_TEXT05 FOOT_TEXT06 FOOT_TEXT07 FOOT_TEXT08
COMPUTE FOOT_TEXT01/A160 = REPLACE(FOOT_TEXT01, '~', ',');
COMPUTE FOOT_TEXT02/A160 = REPLACE(FOOT_TEXT02, '~', ',');
COMPUTE FOOT_TEXT03/A160 = REPLACE(FOOT_TEXT03, '~', ',');
COMPUTE FOOT_TEXT04/A160 = REPLACE(FOOT_TEXT04, '~', ',');
COMPUTE FOOT_TEXT05/A160 = REPLACE(FOOT_TEXT05, '~', ',');
COMPUTE FOOT_TEXT06/A160 = REPLACE(FOOT_TEXT06, '~', ',');
COMPUTE FOOT_TEXT07/A160 = REPLACE(FOOT_TEXT07, '~', ',');
COMPUTE FOOT_TEXT08/A160 = REPLACE(FOOT_TEXT08, '~', ',');
MATCH DUMMY
   ON MATCH REJECT
   ON NOMATCH INCLUDE
DATA
&TEMPTEXT,$
END
-RUN

JOIN CLEAR *
JOIN DUMMY WITH COUNTRY IN CAR TO DUMMY IN TEMPDAT1 AS J1

DEFINE FILE CAR
DUMMY/A1 WITH COUNTRY = 'x';
END

TABLE FILE CAR
SUM
SALES
BY COUNTRY
BY CAR
BY MODEL
FOOTING
" "
"<FOOT_TEXT01"
"<FOOT_TEXT02"
"<FOOT_TEXT03"
"<FOOT_TEXT04"
"<FOOT_TEXT05"
"<FOOT_TEXT06"
"<FOOT_TEXT07"
"<FOOT_TEXT08"
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
 UNITS=IN,
     PAGESIZE='Letter',
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
     MARKUP=ON,
$
TYPE=REPORT, FONT=ARIAL, SIZE=10, $
TYPE=FOOTING, SIZE=8, COLOR=RED, $
END
-RUN


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
February 26, 2020, 04:51 AM
Tony A
… and yes, I know that this uses a variable as input and that yours is a data field but the process might feed your inventiveness and help you find a solution that suits your requirements.

Give the man a rod and teach him to fish … Smiler

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10