As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I have realized that the Dev Studio restrict the number of lines in the column title to 5. Without using Dev Studio if I add more than 5 lines for a column title then I am getting an error. I am reading the title values dynamically. I am replacing the spaces in the title with commas to wrap the title in the PDF version. Sometimes, there can be more than 5 lines. Is there a work around?
TABLE FILE CAR PRINT COUNTRY AS 'THIS,IS,MULTIPLE,LINE,TITLE,FOR,PDF,VERSION,ONLY' END
'Unknown error occurred. Agent on reporting server EDASERVE may have crashed....'
I was going to suggest MARKUP=ON and use the BR tag, but that just trashed the report.
TABLE FILE CAR
PRINT
COUNTRY AS 'THIS<BR>IS<BR>MULTIPLE<BR>LINE<BR>TITLE<BR>FOR<BR>PDF<BR>VERSION<BR>ONLY'
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
MARKUP=ON, $
ENDSTYLE
END
Weird.
I would suggest adding your column titles to the HEADING.
TABLE FILE CAR
HEADING
"THIS"
"IS"
"MULTIPLE"
"LINE"
"TITLE"
"FOR"
"PDF"
"VERSION"
"ONLY<+0>CAR"
PRINT
COUNTRY AS ''
CAR AS ''
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
TYPE=HEADING, LINE=9, ITEM=1, STYLE=UNDERLINE, $
TYPE=HEADING, LINE=9, ITEM=2, STYLE=UNDERLINE, POSITION=CAR, $
ENDSTYLE
END
Thanks Waz. Putting the titles in the heading or subhead is not an option for me. Although IBI recommends using PDF for printing purposes there are many issues with PDF format. To name some, we cannot put borders around the items in the heading or subheadings, titles will not wrap automatically based on the column width, page numbering gets messed up with compound PDF, 5 line restriction in the title, etc. These are very basic features. Clients raise their eyebrows when we go them with our inability to perform these simple features.
I was thinking of using carriage return in the string (Not in Define but in the Dialogue Manager). Do you have any examples? This message has been edited. Last edited by: WFConsultant,
This is kind of a round a bout method but could use the MacGyver to do something similar as what you want for a header. Here is an example based on the CAR table.
FILEDEF MCGMAS DISK MACGYVER.MAS
FILEDEF MCGDAT DISK MACGYVER.DAT
-RUN
-WRITE MCGMAS FILE=MACGYVER,SUFFIX=FOC
-WRITE MCGMAS SEGNAME=MAC1,SEGTYPE=S1
-WRITE MCGMAS FIELD=BLANK , ,A1,INDEX=I,$
-WRITE MCGMAS SEGNAME=MAC2,SEGTYPE=S1,PARENT=MAC1
-WRITE MCGMAS FIELD=COUNTER,ORDER,I4,$
-RUN
CREATE FILE MACGYVER
MODIFY FILE MACGYVER
COMPUTE CTR/I9=;
FIXFORM 2(CTR/4 X-4)
COMPUTE
BLANK=' ';
COUNTER=IF COUNTER EQ 0 THEN CTR ELSE COUNTER+1;
MATCH BLANK
ON MATCH CONTINUE
ON NOMATCH INCLUDE
MATCH COUNTER
ON MATCH CONTINUE
ON NOMATCH INCLUDE
DATA
1
END
-RUN
JOIN
BLANK WITH COUNTRY IN CAR TO
BLANK IN MACGYVER AS B_
END
DEFINE FILE CAR
BLANK/A1 WITH COUNTRY=' ';
LF/A1 = HEXBYT(10, 'A1');
COUNTRY_NEW/A63=IF COUNTER EQ 1 THEN 'THIS'|LF|'IS'|LF|'MULTIPLE'|LF|'LINE'|LF|'TITLE'|LF|'FOR'|LF|'PDF'|LF|'VERSION'|LF|'ONLY' ELSE COUNTRY;
END
TABLE FILE CAR
BY COUNTER NOPRINT
BY COUNTRY_NEW AS ''
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
$
DEFMACRO=COND0001,
MACTYPE=RULE,
WHEN=COUNTER EQ 1,
$
TYPE=DATA,
BORDER-BOTTOM=MEDIUM,
MACRO=COND0001,
$
TYPE=REPORT, LINEBREAK=LF,SQUEEZE=1.5,$
ENDSTYLE
END
Wow! Report Painter is really verbose (expressive?) when it comes to StyleSheet declarations. I managed to remove more than a few lines that added no significant value ... I didn't clean the whole thing up though ...
This makes use of the Alignment Grid feature introduced (I think) in 7.6.10 ...
That's true Waz and it is why I included that caveat before. As you say, 7.x encompasses a whole range of releases in it so hopefully WFConsultant's is at least 7.6.1x.
The change introduced was actually the capability of having HEADALIGN=BODY recognized and exploited in PDF documents which opens up a lot of styling possibilities (like COLSPAN) not available before for that output format.
You indicated in the original post that you "read" the title values dynamically. If so, you may be able to use something like the code below to divide your titles into chunks that will not exceed the maximum number of title lines. It uses the PARAG function to split the titles into roughly equal-length lines.
SET DMPRECISION=0
-RUN
-SET &TITLE1 = 'THIS IS THE FIRST MULTIPLE LINE TITLE FOR COLUMN COUNTRY';
-SET &TITLE2 = 'THIS IS THE SECOND MULTIPLE LINE TITLE FOR COLUMN CAR';
-SET &TITLE3 = 'THIS IS A REALLY REALLY REALLY LONG MULTIPLE LINE TITLE FOR COLUMN MODEL TO TEST OUTPUT IN PDF FORMAT';
-SET &TITLE1_LENGTH = ARGLEN(&TITLE1.LENGTH,&TITLE1,'I5');
-SET &TITLE2_LENGTH = ARGLEN(&TITLE2.LENGTH,&TITLE2,'I5');
-SET &TITLE3_LENGTH = ARGLEN(&TITLE3.LENGTH,&TITLE3,'I5');
-SET &SUBSIZE1 = &TITLE1_LENGTH / 4 ;
-SET &SUBSIZE2 = &TITLE2_LENGTH / 4 ;
-SET &SUBSIZE3 = &TITLE3_LENGTH / 4 ;
-SET &TITLE_COUNTRY = PARAG(&TITLE1.LENGTH,&TITLE1,',',&SUBSIZE1,'A&TITLE1.LENGTH');
-SET &TITLE_CAR = PARAG(&TITLE2.LENGTH,&TITLE2,',',&SUBSIZE2,'A&TITLE2.LENGTH');
-SET &TITLE_MODEL = PARAG(&TITLE3.LENGTH,&TITLE3,',',&SUBSIZE3,'A&TITLE3.LENGTH');
-*
TABLE FILE CAR
PRINT
COUNTRY AS '&TITLE_COUNTRY'
CAR AS '&TITLE_CAR'
MODEL AS '&TITLE_MODEL'
ON TABLE PCHOLD FORMAT PDF
END
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
This creates the multiple titles and a line of dashes followed by the detail. It creates dummy rows for the titles and dashes and calulates the number of required pages based upon the data and your required number of rows per page (detail rows p/p plus 2). This requires multiple passes but does work.
-*Workaround example when requiring more than 5 (WF limit) lines in a column title (PDF).
-*
APP PREPENDPATH IBISAMP
SET ASNAMES=ON
-*Get total record count
TABLE FILE GGSALES
SUM CNT.CATEGORY
ON TABLE SAVE AS S1
END
-RUN
-READ S1 &RECCNT.I5
-*
-*Set your required lines per page (including 2 title lines (text is one line, dashes as second line)
-SET &NUM_LINES = 32;
-*Calc number of pages required
-SET &PGS = (&RECCNT / (&NUM_LINES-2) )+ 1;
-*
-* CNTR* fields calculate the sort order of Title Text followed by Dashes followed by detail lines.
DEFINE FILE GGSALES
CNTR0/I5 WITH CATEGORY = CNTR0+1;
CNTR1/I5 WITH CATEGORY = IF CNTR0 EQ 1 THEN 1 ELSE (&NUM_LINES * (CNTR0-1)) + 1;
CNTR2/I5 WITH CATEGORY = CNTR1+1;
CNTR3/I5 WITH CATEGORY = CNTR2+1;
CNTR4/I5 WITH CATEGORY = IF CNTR0 EQ 1 THEN 1 ELSE IF LAST CNTR4 EQ (&NUM_LINES - 2) THEN 1 ELSE CNTR4 + 1;
CNTR5/I5 WITH CATEGORY = IF CNTR0 EQ 1 THEN 3 ELSE IF CNTR4 EQ 1 THEN CNTR5+3 ELSE CNTR5+1;
CATX/A11 WITH CATEGORY = ' ';
DATEX/I8YYMD WITH CATEGORY =;
CITYX/A20 WITH CATEGORY = 'X';
CATY/A11 WITH CATEGORY = ' ';
DATEY/I8YYMD WITH CATEGORY =;
CITYY/A20 WITH CATEGORY = 'Y';
END
-*
-*Create a file with a dummy row for title line text for each needed page (&PGS)
TABLE FILE GGSALES
PRINT CNTR1 AS CNTR CATX AS CATEGORY DATEX AS DATE CITYX AS CITY
IF RECORDLIMIT EQ &PGS
ON TABLE HOLD AS HOLD1
END
-RUN
-*
DEFINE FILE GGSALES ADD
CATY/A11 WITH CATEGORY = ' ';
DATEY/I8YYMD WITH CATEGORY =;
CITYY/A20 WITH CATEGORY = 'Y';
END
-*
-*Create a file with a dummy row for dashes for each needed page (&PGS)
TABLE FILE GGSALES
PRINT CNTR2 AS CNTR CATY AS CATEGORY DATEY AS DATE CITYY AS CITY
IF RECORDLIMIT EQ &PGS
ON TABLE HOLD AS HOLD2
END
-RUN
-*
-*Get report detail lines
TABLE FILE GGSALES
PRINT CNTR5 AS CNTR CATEGORY DATE CITY
ON TABLE HOLD AS HOLD3
END
-RUN
-*
-*Merge files
TABLE FILE HOLD1
PRINT *
ON TABLE HOLD AS HOLD4
MORE
FILE HOLD2
MORE
FILE HOLD3
END
-RUN
-*
-*Dynamic title values
-SET &T1 = 'THIS';
-SET &T2 = 'IS';
-SET &T3 = 'AN';
-SET &T4 = 'ATTEMPT';
-SET &T5 = 'AT';
-SET &T6 = 'MORE';
-SET &T7 = 'THAN';
-SET &T8 = 'FIVE';
-SET &T9 = 'LINES';
-SET &T10 = 'IN';
-SET &T11 = 'A';
-SET &T12 = 'TITLE';
-SET &T13 = 'CATEGORY';
-SET &T14 = 'DATE';
-SET &T15 = 'CITY';
-*
DEFINE FILE HOLD4
DUM/A1 = '';
CTR/I3 = IF CTR GE &NUM_LINES THEN 1 ELSE CTR + 1;
CRLF/A2 = HEXBYT(13,'A1') | HEXBYT(10,'A1');
DATE/A8YYMD = EDIT(DATE);
CRLF1/A100 = IF CITY EQ 'X' THEN '&T1'||CRLF||'&T2'|CRLF||'&T3'||CRLF||'&T4'||CRLF||'&T5'||CRLF||'&T6'||CRLF||'&T7'||CRLF||'&T8'||CRLF||'&T9'||CRLF||'&T10'||CRLF||'&T11'||CRLF||'&T12'||CRLF||'&T13' ELSE
IF CITY EQ 'Y' THEN '----------' ELSE CATEGORY;
CRLF2/A100 = IF CITY EQ 'X' THEN '&T1'||CRLF||'&T2'|CRLF||'&T3'||CRLF||'&T4'||CRLF||'&T5'||CRLF||'&T6'||CRLF||'&T7'||CRLF||'&T8'||CRLF||'&T9'||CRLF||'&T10'||CRLF||'&T11'||CRLF||'&T12'||CRLF||'&T14' ELSE
IF CITY EQ 'Y' THEN '----------' ELSE DATE;
CRLF3/A100 = IF CITY EQ 'X' THEN '&T1'||CRLF||'&T2'|CRLF||'&T3'||CRLF||'&T4'||CRLF||'&T5'||CRLF||'&T6'||CRLF||'&T7'||CRLF||'&T8'||CRLF||'&T9'||CRLF||'&T10'||CRLF||'&T11'||CRLF||'&T12'||CRLF||'&T15' ELSE
IF CITY EQ 'Y' THEN '-------------' ELSE CITY;
END
-*
-*Sort by CNTR5 to get in proper order (title text row, dashes row, detail row)
TABLE FILE HOLD4
PRINT CRLF1 AS ''
CRLF2 AS ''
CRLF3 AS ''
BY DUM NOPRINT PAGE-BREAK WHEN CTR EQ &NUM_LINES
BY CNTR NOPRINT
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET STYLE *
ORIENTATION=LANDSCAPE,$
TYPE=REPORT,LINEBREAK='CRLF',$
TYPE=REPORT,SQUEEZE=1.5,$
ENDSTYLE
END
-RUN
Waz, I am working on 7.6.10. So, njsden’s solution won’t work for me.
I did test with PARAG function. However, it is not consistent. Particularly when there are words longer than the subsize. In the following example, the title word, THIS_IS_ONE_LONG, is 16 characters in length. In PARAG I am setting subsize to 15 characters. PARAG replaces the 16th character with comma. Therefore the title becomes THIS_IS_ONE_LON. This is wrong.
-SET &ECHO = 'ALL'; -* CHECK FILE CAR HOLD AS HFLDS -* DEFINE FILE HFLDS TITLE_NEW/A50 = DECODE FIELDNAME('CAR' 'THIS_IS_ONE_LONG TITLE', 'MODEL' 'THIS_IS_TITLE_FOR MODEL' ); LEN/I4 = ARGLEN(50, TITLE_NEW, LEN); TITLE1/A50 = PARAG(LEN, TITLE_NEW, ',', 15, TITLE1); END -RUN -* TABLE FILE HFLDS PRINT FIELDNAME TITLE1 WHERE FIELDNAME IN ('CAR','MODEL') ON TABLE HOLD AS HRPT END -RUN -* -SET &STR = ''; -REPEAT :L1 2 TIMES -READ HRPT &FIELD.A66 &TITLE.A50. -SET &FIELD = LJUST(66, '&FIELD.EVAL', 'A66'); -SET &FIELD = TRUNCATE ('&FIELD.EVAL'); -SET &TITLE = LJUST(50, '&TITLE.EVAL', 'A50'); -SET &TITLE = TRUNCATE ('&TITLE.EVAL'); -SET &STR = &STR | '&FIELD.EVAL AS ''&TITLE.EVAL'' '; -:L1 -RUN -* TABLE FILE CAR PRINT &STR.EVAL BY COUNTRY ON TABLE PCHOLD FORMAT PDF ENDThis message has been edited. Last edited by: WFConsultant,