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'd like to develop a compound report, which consists of several pieces, which seems possible at first sight. In this report, a user has to choose a country. For this country, I'd like to see: - The specifications for every single carmodel - The salesfigures for every single carmodel
Obviously, WebFOCUS tend to print ALL specifications first for ALL models, and then prints ALL salesfigures for ALL carmodels.
How can I enhance the code such, that the compound report is broken down and prints correctly per carmodel? The Code: [
-* File Car_compound.fex SET COMPOUND = OPEN NOBREAK TABLE FILE CAR BY CAR NOPRINT ON TABLE SUBHEAD "Detail information for country "text" "text" " " WHERE COUNTRY EQ 'JAPAN'; ON TABLE SET PAGE-NUM OFF ON TABLE PCHOLD FORMAT PDF END
-* Report 1
TABLE FILE CAR SUM SEATS DEALER_COST BY CAR NOPRINT PAGE-BREAK BY MODEL WHERE COUNTRY EQ 'JAPAN'; HEADING "Specifications for model "text " "text " "" FOOTING "text about this car" ON TABLE SET PAGE-NUM OFF ON TABLE PCHOLD FORMAT PDF END
-* Report 2
SET COMPOUND = CLOSE TABLE FILE CAR SUM RETAIL_COST SALES BY CAR NOPRINT PAGE-BREAK BY MODEL WHERE COUNTRY EQ 'JAPAN'; HEADING "Sales figures for model FOOTING "Rundate <+0>&DATED<+0>-<+0>&DATEM<+0>-<+0>&DATEYY<+0> om <+0>&TOD" ON TABLE SET PAGE-NUM OFF ON TABLE PCHOLD FORMAT PDF CLOSE END ]This message has been edited. Last edited by: Kerry,
If you need to merge the sales figures with the specifications, then I can think of two ways to do this.
1. Create a loop with Dialog Manager inside the compound report, so each part only reports on the same level of data.
2. Use co-ordinated compound report, this has an option to merge on the highest sort field.
Depending on how simple the data is, you may be able to get away with joining you data together and use a single TABLE FILE with appropriate SUBHEADs ad SUBFOOTs.
This isn't the nicest looking since getting the columns named will be difficult but is a way. It uses the MacGyver master file to duplicate rows.
Also making a hold file before is not needed unless like in this case is more than one data path like this example with CAR is.
* File Car_compound.fex
-SET &COUNTRY='JAPAN';
TABLE FILE CAR
SUM
SEATS
RETAIL_COST
DEALER_COST
SALES
BY CAR
BY MODEL
ON TABLE HOLD AS CARHOLD
END
-*MacGyver
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
-*Replace the 2 in the line: FIXFORM 2(CTR/4 X-4) : To increase how many duplicate lines
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 CAR IN CARHOLD TO
BLANK IN MACGYVER AS B_
END
DEFINE FILE CARHOLD
BLANK/A1 WITH CAR=' ';
COLUMN_ONE/I7=IF COUNTER EQ 1 THEN SEATS ELSE RETAIL_COST;
COLUMN_TWO/I7=IF COUNTER EQ 1 THEN DEALER_COST ELSE SALES;
END
TABLE FILE CARHOLD
PRINT
COLUMN_ONE
COLUMN_TWO
BY COUNTER NOPRINT
BY CAR NOPRINT
BY MODEL
ON COUNTER SUBHEAD
"Specifications for model"
"text "
""
WHEN COUNTER EQ 1;
ON COUNTER SUBHEAD
"Sales figures for model "
WHEN COUNTER EQ 2;
ON COUNTER SUBFOOT
""
HEADING
"Detail information for country &COUNTRY"
"text"
" "
FOOTING
"Rundate <+0>&DATED<+0>-<+0>&DATEM<+0>-<+0>&DATEYY<+0> om <+0>&TOD"
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE PCHOLD FORMAT PDF
END
-EXIT
Thanks for your solutions. The loop option was the answer, we created this code. As you can mention the tricky part was to close the pdf document as the last record was read, so this is a variable line. Case is closed!
-SET &COUNTRY = 'JAPAN'
TABLE FILE CAR PRINT MODEL BY MODEL NOPRINT WHERE COUNTRY EQ '&COUNTRY'; ON TABLE HOLD AS HLD_FILE1 FORMAT ALPHA END
-RUN -SET &TELLER = 1; -SET &AANT_LOOP = &LINES;
SET COMPOUND = OPEN NOBREAK TABLE FILE CAR BY CAR NOPRINT WHERE COUNTRY EQ '&COUNTRY'; ON TABLE SUBHEAD "Detail information for country "text" "text" " " ON TABLE SET PAGE-NUM OFF ON TABLE PCHOLD FORMAT PDF END
-REPEAT :LEES_MODEL &AANT_LOOP TIMES -READ HLD_FILE1 &MODEL.A24. -TYPE &MODEL
-SET &VAR_CMP = IF &TELLER EQ &AANT_LOOP THEN CLOSE ELSE OPEN;
-* Report 1
TABLE FILE CAR SUM SEATS DEALER_COST BY CAR NOPRINT PAGE-BREAK BY MODEL WHERE MODEL EQ '&MODEL'; WHERE COUNTRY EQ '&COUNTRY'; HEADING "Specifications for model "text " "text " "" FOOTING "text about this car" ON TABLE SET PAGE-NUM OFF ON TABLE PCHOLD FORMAT PDF END
-* Report 2
SET COMPOUND = &VAR_CMP TABLE FILE CAR SUM RETAIL_COST SALES BY CAR NOPRINT PAGE-BREAK BY MODEL WHERE MODEL EQ '&MODEL'; WHERE COUNTRY EQ '&COUNTRY'; HEADING "Sales figures for model FOOTING "Rundate <+0>&DATED<+0>-<+0>&DATEM<+0>-<+0>&DATEYY<+0> om <+0>&TOD" ON TABLE SET PAGE-NUM OFF ON TABLE PCHOLD FORMAT PDF