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.
We're having two issues with mailing labels. 1. The business would like us to start a fresh page of mailing labels when we change relationship codes. The page-break feature is not working and I believe it's because the system figures each label is a new page. Has anyone figured out a way around this?
2. The other issue is they want a header at the top of the page. In essense right above the labels. I can't seem to get that to work. I have been able to create the first label to be the header, but they would prefer the header at the top of the page (they want the relationship code at the top so they know who to send the labels to).
Here is the code:
SET LINES=999999
DEFINE FILE MAILING_LABELS_VIEW AU/A10=IF MAILING_TYPE_ID EQ 1 THEN EMPL_COST_CENTER ELSE ' '; END
TABLE FILE MAILING_LABELS_VIEW BY REL_SEI_CD NOPRINT BY MAILING_TYPE_DESCR NOPRINT BY RECIP_INTRO NOPRINT BY RECIP_FIRST_NM NOPRINT BY RECIP_LAST_NM NOPRINT BY RECIP_TITLE NOPRINT BY RECIP_OTHER_NM NOPRINT BY ADDR_LINE1 NOPRINT BY ADDR_LINE2 NOPRINT BY ADDR_LINE3 NOPRINT BY ADDR_LINE4 NOPRINT BY ADDR_CITY NOPRINT BY ADDR_STATE_PROV_SHORT_DESCR NOPRINT BY ADDR_POSTAL_CD NOPRINT BY AU NOPRINT
WHERE REL_SEI_CD IN ('!DAVE','12THM') -* this is for the overall heading and what we want to page break on to a new sheet of labels ON REL_SEI_CD PAGE-BREAK AND SUBHEAD " " "" " " " " " " " " " " "
ON ADDR_LINE1 PAGE-BREAK
ON TABLE SET NODATA ' '
ON ADDR_LINE1 SUBHEAD "<25>" ON ADDR_LINE1 SUBHEAD "WHEN RECIP_TITLE IS NOT MISSING
ON ADDR_LINE1 SUBHEAD "WHEN RECIP_OTHER_NM IS NOT MISSING
ON ADDR_LINE1 SUBHEAD "WHEN ADDR_LINE1 IS NOT MISSING
ON ADDR_LINE2 SUBHEAD "WHEN ADDR_LINE2 IS NOT MISSING
ON ADDR_LINE3 SUBHEAD "WHEN ADDR_LINE3 IS NOT MISSING
ON ADDR_LINE4 SUBHEAD "WHEN ADDR_LINE4 IS NOT MISSING
ON ADDR_CITY SUBHEAD " ON TABLE SET PAGE-NUM OFF ON TABLE SET ONLINE-FMT PDF
Here's an example using the CAR file. This will print labels two across and three down(six per page). You get a page break when the country code changes(this would be your relationship code).
SET PAGE-NUM=NOPAGE SET NODATA='' -* TABLE FILE CAR PRINT MODEL BY COUNTRY BY CAR ON TABLE HOLD AS HLD_LBLS END -* DEFINE FILE HLD_LBLS CNTR/I6 = CNTR + 1; COU_CNTR/I6 = IF COUNTRY EQ LAST COUNTRY THEN COU_CNTR + 1 ELSE 1; T_LINE1/A36 = '************************************'; T_LINE2/A36 = 'CNT: ' | EDIT(COU_CNTR) | '/' | EDIT(CNTR); T_LINE3/A36 = 'COU: ' | COUNTRY; T_LINE4/A36 = 'CAR: ' | CAR; T_LINE5/A36 = 'MOD: ' | MODEL; T_LINE6/A36 = '************************************'; XCOU/I4 = IF COUNTRY EQ LAST COUNTRY THEN XCOU ELSE XCOU + 1; XLBL/I4 = IF ( (XCOU NE LAST XCOU) OR (XLBL EQ 6) ) THEN 1 ELSE XLBL + 1; XPAG/I4 = IF XCOU NE LAST XCOU THEN 1 ELSE (IF XLBL EQ 1 THEN XPAG + 1 ELSE XPAG); XCOL/I4 = IF ( (XLBL EQ 1) OR (XCOL EQ 2) ) THEN 1 ELSE XCOL + 1; XROW/I4 = IF XLBL EQ 1 THEN 1 ELSE (IF XCOL EQ 1 THEN XROW + 1 ELSE XROW); END -* TABLE FILE HLD_LBLS HEADING "COUNTRY: PAGE: " SUM T_LINE1 AS '' OVER T_LINE2 AS '' OVER T_LINE3 AS '' OVER T_LINE4 AS '' OVER T_LINE5 AS '' OVER T_LINE6 AS '' BY XCOU NOPRINT BY COUNTRY NOPRINT BY XPAG NOPRINT BY XROW NOPRINT ACROSS XCOL NOPRINT ON XPAG PAGE-BREAK ON XROW SUBHEAD " " ON XROW SUBFOOT " " ON TABLE SET ONLINE-FMT PDF ON TABLE SET STYLE * LEFTMARGIN=0.152778, RIGHTMARGIN=0.000000, TOPMARGIN=0.100000, BOTTOMMARGIN=0.000000, ORIENTATION=PORTRAIT, $ TYPE=SUBHEAD, SIZE=5, TOPGAP=0.1800, $ TYPE=SUBFOOT, SIZE=5, TOPGAP=0.7200, $ ENDSTYLE END
Take a look and let me know if this might work.
Jim
WF DevStu 5.2.6/WF Srv 5.2.4/Win NT 5.2
Posts: 118 | Location: Lincoln Nebraska | Registered: May 04, 2005
I just noticed the heading above did not post correctly. The following is what it should be but you need to replace the # with the "less than" sign.
HEADING "COUNTRY: #COUNTRY #68 PAGE: #LST.XPAG"
I only printed six labels per page because the CAR file only had one country with more than six records and I wanted to make sure it would page break after six. There's also a trick to squeeze out blank lines in the label if you would need to do that.
Jim
WF DevStu 5.2.6/WF Srv 5.2.4/Win NT 5.2
Posts: 118 | Location: Lincoln Nebraska | Registered: May 04, 2005
how come you use lst.xpag? It works but I don't understand why it works. If we just use xpag we get the wrong results but why would you want the last xpag found instead of the first one found?
Plus, the business wants page 1 of 2 (WITHIN COUNTRY in your case ... so they don't want the total number of pages for the whole report they want the total number of pages within the relationship code) and I've been playing around for a while to get the "max" page numbers within the country but it doesn't want to work. Is it because it's in a heading or because I'm doing something wrong
I figured out the page 1 of max page numbering (I believe) by adding in another sum. Here is the code (I didn't include all of it since it's mentioned above).
TABLE FILE HLD_LBLS HEADING "COUNTRY: SUM MAX.XPAG NOPRINT BY XCOU NOPRINT BY COUNTRY NOPRINT SUM T_LINE1 AS '' OVER T_LINE2 AS '' OVER T_LINE3 AS '' OVER T_LINE4 AS '' OVER T_LINE5 AS '' OVER T_LINE6 AS '' OVER XPAG BY XCOU NOPRINT BY COUNTRY NOPRINT BY XPAG NOPRINT BY XROW NOPRINT ACROSS XCOL NOPRINT ON XPAG PAGE-BREAK
I had seen this code but it has a comment that if the total of your concatenated fields is greater than 256 it won't work. We have 9 fields of 60 characters, so I didn't even try it. I ended up doing it the long way.
T_LINE2/A80 = XNAME1 | EMPL_COST_CENTER; T_LINE3/A60 = IF RECIP_TITLE NE ' ' THEN RECIP_TITLE ELSE IF RECIP_OTHER_NM NE ' ' THEN RECIP_OTHER_NM ELSE IF ADDR_LINE1 NE ' ' THEN ADDR_LINE1 ELSE IF ADDR_LINE2 NE ' ' THEN ADDR_LINE2 ELSE IF ADDR_LINE3 NE ' ' THEN ADDR_LINE3 ELSE IF ADDR_LINE4 NE ' ' THEN ADDR_LINE4 ELSE CITY; T_LINE4/A60 = IF (T_LINE3 NE RECIP_OTHER_NM AND RECIP_OTHER_NM NE ' ') THEN RECIP_OTHER_NM ELSE IF (T_LINE3 NE ADDR_LINE1 AND ADDR_LINE1 NE ' ') THEN ADDR_LINE1 ELSE IF (T_LINE3 NE ADDR_LINE2 AND ADDR_LINE2 NE ' ') THEN ADDR_LINE2 ELSE IF (T_LINE3 NE ADDR_LINE3 AND ADDR_LINE3 NE ' ') THEN ADDR_LINE3 ELSE IF (T_LINE3 NE ADDR_LINE4 AND ADDR_LINE4 NE ' ') THEN ADDR_LINE4 ELSE IF (T_LINE3 NE CITY AND CITY NE ' ') THEN CITY ELSE ' '; T_LINE5/A60 = IF (T_LINE4 NE ADDR_LINE1 AND ADDR_LINE1 NE ' ') THEN ADDR_LINE1 ELSE IF (T_LINE4 NE ADDR_LINE2 AND ADDR_LINE2 NE ' ') THEN ADDR_LINE2 ELSE IF (T_LINE4 NE ADDR_LINE3 AND ADDR_LINE3 NE ' ') THEN ADDR_LINE3 ELSE IF (T_LINE4 NE ADDR_LINE4 AND ADDR_LINE4 NE ' ') THEN ADDR_LINE4 ELSE IF (T_LINE4 NE CITY AND CITY NE ' ') THEN CITY ELSE ' '; T_LINE6/A60 = IF (T_LINE5 NE ADDR_LINE2 AND ADDR_LINE2 NE ' ') THEN ADDR_LINE2 ELSE IF (T_LINE5 NE ADDR_LINE3 AND ADDR_LINE3 NE ' ') THEN ADDR_LINE3 ELSE IF (T_LINE5 NE ADDR_LINE4 AND ADDR_LINE4 NE ' ') THEN ADDR_LINE4 ELSE IF (T_LINE4 NE CITY AND T_LINE5 NE CITY) AND CITY NE ' ' THEN CITY ELSE ' '; T_LINE7/A60 = IF (T_LINE6 NE ADDR_LINE3 AND ADDR_LINE3 NE ' ') THEN ADDR_LINE3 ELSE IF (T_LINE6 NE ADDR_LINE4 AND ADDR_LINE4 NE ' ') THEN ADDR_LINE4 ELSE IF (T_LINE4 NE CITY AND T_LINE5 NE CITY AND T_LINE6 NE CITY) AND CITY NE ' ' THEN CITY ELSE ' '; T_LINE8/A60 = IF (T_LINE7 NE ADDR_LINE4 AND ADDR_LINE4 NE ' ') THEN ADDR_LINE4 ELSE IF (T_LINE4 NE CITY AND T_LINE5 NE CITY AND T_LINE6 NE CITY AND T_LINE7 NE CITY) AND CITY NE ' ' THEN CITY ELSE ' '; T_LINE9/A60 = IF (T_LINE4 NE CITY AND T_LINE5 NE CITY AND T_LINE6 NE CITY AND T_LINE7 NE CITY AND T_LINE8 NE CITY) AND CITY NE ' ' THEN CITY ELSE ' ';
That depends on what version of focus you are using. We have an older version of focus running on VMS that still only allows for alpha fields up to 256 characters. Our newer version of WebFocus(5.something) allows for alpha fields that are much larger.
WF DevStu 5.2.6/WF Srv 5.2.4/Win NT 5.2
Posts: 118 | Location: Lincoln Nebraska | Registered: May 04, 2005
One more issue. We have 2 fields that the business wants right justified. I tried right justifying in the stylesheet and it only did column1 of that field (the labels are 2 x 5). So, the right hand column of the labels the justifying did not have any impact Has this occurred to anyone else?
I ended up trying to rjust in the define but it's not working as expected. It's right justifying but all the fields are not lining up in the same position. I think the problem is because we use an arial font ... is there away around this problem and still be able to use the arial font?
-* File labels1.fex -*DEFAULTS &OUT_STYLE = 3 FILEDEF OUTFILE DISK /app01/u02/logs/ibuilders/ibidir/rpt_KDQUHKo_h.rpt -SET &OUT_STYLE = 3; SET ALL=ON SET EMPTYREPORT=ON SET NODATA = ' ' SET PAGE-NUM=NOPAGE
-* Decide whether to output HTML or alternate format: -IF &OUT_STYLE EQ 0 GOTO STEP_HTML; -IF &OUT_STYLE EQ 1 GOTO EXCEL; -IF &OUT_STYLE EQ 2 GOTO TAB_CSV; -IF &OUT_STYLE EQ 3 GOTO PDF; -* Else prepare HTML output:
-PDF TABLE FILE MAILING_LABELS_VIEW PRINT MAILING_TYPE_DESCR RECIP_INTRO RECIP_FIRST_NM RECIP_LAST_NM RECIP_MIDDLE_NM RECIP_SUFFIX_NM RECIP_TITLE RECIP_OTHER_NM ADDR_LINE1 ADDR_LINE2 ADDR_LINE3 ADDR_LINE4 ADDR_CITY ADDR_STATE_PROV_SHORT_DESCR ADDR_POSTAL_CD EMPL_COST_CENTER BY REL_SEI_CD WHERE REL_SEI_CD IN ('ALPER') -*BY ADDR_LINE1 ON TABLE NOTOTAL ON TABLE HOLD AS HLD_LBLS END
XCOU/I4 = IF REL_SEI_CD EQ LAST REL_SEI_CD THEN XCOU ELSE XCOU + 1; XLBL/I4 = IF ( (XCOU NE LAST XCOU) OR (XLBL EQ 10) ) THEN 1 ELSE XLBL + 1; XPAG/I4 = IF XCOU NE LAST XCOU THEN 1 ELSE (IF XLBL EQ 1 THEN XPAG + 1 ELSE XPAG); XCOL/I4 = IF ( (XLBL EQ 1) OR (XCOL EQ 2) ) THEN 1 ELSE XCOL + 1; XROW/I4 = IF XLBL EQ 1 THEN 1 ELSE (IF XCOL EQ 1 THEN XROW + 1 ELSE XROW); END
TABLE FILE HLD_LBLS HEADING "Mailing Labels For: SUM MAX.XPAG NOPRINT BY XCOU NOPRINT BY REL_SEI_CD NOPRINT REPAGE
SUM T_LINE1 AS '' OVER T_LINE2 AS '' OVER T_LINE3 AS '' OVER T_NL4 AS '' OVER T_NL5 AS '' OVER T_NL6 AS '' OVER T_NL7 AS '' OVER T_NL8 AS '' OVER T_NL9 AS '' OVER T_NL10 AS '' -NOMORE BY XCOU NOPRINT BY REL_SEI_CD NOPRINT BY XPAG NOPRINT BY XROW NOPRINT
ACROSS XCOL NOPRINT ON XPAG PAGE-BREAK ON XROW SUBHEAD " " ON XROW SUBFOOT " " ON TABLE SET ONLINE-FMT PDF -*ON TABLE HOLD AS OUTFILE FORMAT PDF ON TABLE SET STYLE * UNITS=IN, PAGESIZE='Letter', LEFTMARGIN=0.152778, RIGHTMARGIN=0.000000, -* TOPMARGIN=0.010000, -* BOTTOMMARGIN=0.200000, SQUEEZE=ON, ORIENTATION=PORTRAIT, $ LABELNAME=AVERY 5163 ADDRESS, LABELPROMPT=OFF, $ TYPE=REPORT, FONT='ARIAL', SIZE=12, STYLE=NORMAL, $ TYPE=HEADING, FONT='ARIAL', SIZE=8, STYLE=NORMAL, $ TYPE=SUBHEAD, SIZE=5, TOPGAP=0.13000, $ TYPE=SUBFOOT, SIZE=5, TOPGAP=0.05000, $
I used this coding and it worked great, however, it printed a line across the top of each page and when my page break field of 'process level' went to more than 1 page, it printed a blank page in between with the annoying line. I also had to play with the settings to get Avery 5160/8160 to work. I'm putting my code here to help others. I ended up changing the pagesize in order to get the last labels to print at the bottom without forcing a premature page break or another blank page when there was more than 1 page for a process level.
SET PAGE-NUM=NOPAGE SET PAGESIZE=GERMAN-STANDARD-FANFOLD SET NODATA='' -* get rid of annoying line across top of page SET ACROSSLINE=OFF
-HOLDFILE TABLE FILE EMPLOYEE PRINT EMPLOYEE MIDDLE_INIT EMP_STATUS PROCESS_LEVEL JOB_CODE BY COMPANY BY PROCESS_LEVEL BY LAST_NAME BY FIRST_NAME WHERE (COMPANY EQ 7 ); WHERE (EMP_STATUS EQ '1F' OR '2B' OR '1C' OR '1B'); WHERE PROCESS_LEVEL IN ('9702','9708','9724','9726','9745','9750','9751','9771','9773'); ON TABLE HOLD AS HOLDLAB END
WEEK_END_DATE/YYMD = IF DAYNBR EQ 1 THEN DATEADD(CR_DATE,'D',13) ELSE IF DAYNBR EQ 2 THEN DATEADD(CR_DATE,'D',12) ELSE IF DAYNBR EQ 3 THEN DATEADD(CR_DATE,'D',11) ELSE IF DAYNBR EQ 4 THEN DATEADD(CR_DATE,'D',10) ELSE IF DAYNBR EQ 5 THEN DATEADD(CR_DATE,'D',9) ELSE IF DAYNBR EQ 6 THEN DATEADD(CR_DATE,'D',8) ELSE IF DAYNBR EQ 7 THEN DATEADD(CR_DATE,'D',7); CNTR/I6 = CNTR + 1; PL_CNTR/I6 = IF PROCESS_LEVEL EQ LAST PROCESS_LEVEL THEN PL_CNTR + 1 ELSE 1; L2_EMP/A11 = EDIT(EMPLOYEE); TRIM_L2_EMP/A6 = TRIM('L',L2_EMP,11,'0',1,'A6'); P_WK/MDYY = WEEK_END_DATE; ALPHA_P_WK/A8MDYY = P_WK;
XPL/I4 = IF PROCESS_LEVEL EQ LAST PROCESS_LEVEL THEN XPL ELSE XPL + 1; XLBL/I4 = IF ( (XPL NE LAST XPL) OR (XLBL EQ 30) ) THEN 1 ELSE XLBL + 1; XPAG/I4 = IF XPL NE LAST XPL THEN 1 ELSE (IF XLBL EQ 1 THEN XPAG + 1 ELSE XPAG); XCOL/I4 = IF ( (XLBL EQ 1) OR (XCOL EQ 3) ) THEN 1 ELSE XCOL + 1; XROW/I4 = IF XLBL EQ 1 THEN 1 ELSE (IF XCOL EQ 1 THEN XROW + 1 ELSE XROW); END
-LABELS TABLE FILE HOLDLAB SUM T_LINE1 AS '' OVER T_LINE2 AS '' OVER T_LINE3 AS '' OVER T_LINE4 AS '' OVER T_LINE5 AS '' BY XPL NOPRINT BY PROCESS_LEVEL NOPRINT BY XPAG NOPRINT BY XROW NOPRINT ACROSS XCOL NOPRINT ON XPAG PAGE-BREAK ON TABLE SET PAGE-NUM NOPAGE ON TABLE SET ONLINE-FMT PDF ON TABLE SET STYLE * UNITS=IN, -* PAGESIZE='Letter', SQUEEZE=ON, ORIENTATION=PORTRAIT, LEFTMARGIN=0.15, RIGHTMARGIN=0.188, TOPMARGIN=0.09000, BOTTOMMARGIN=0.000000,$ RIGHTGAP=0.55000,$ LEFTGAP=0.20000,$ TOPGAP=0.083,$ FONT=ARIAL,$ SIZE=11,$ ENDSTYLE END
Posts: 20 | Location: Syracuse NY | Registered: August 26, 2005