Focal Point
[SOLVED]multi section with different columns

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

April 08, 2011, 12:06 AM
TCL
[SOLVED]multi section with different columns
Can we produce a report in webfocus that contains alternate sections with different column formats. A report print out a block of master information follow by a block of details rows, then repeat for another groups. Somewhat similar to printing a batch of invoices with master information and line item details.

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


WebFOCUS 764, Oracle to produce report
April 08, 2011, 04:45 AM
FrankDutch
yes you can

create a compound report, search in this section for help on that or use the documentation




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

April 08, 2011, 08:10 AM
Kathy P
One way would be a 'coordinated compound report' utilizing two reports. The first report would be a summary report. The second report would be the detail report. Use the same sort field for both reports. Do not use a defined field for a sort field though. May not work. Hope this helps.


Kathy Phillips
Web FOCUS 8.2.05.14, 8.1.05, 8.08, 8.0.7, 8.0.5,8.0.2m, 7.6.10,7.7.03
Windows
April 08, 2011, 10:01 AM
FrankDutch
if you put the compound report in one PDF you can even make a drill through in that report

in the code you place after the first PDF OPEN
after the second (last) PDF CLOSE




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

April 08, 2011, 11:14 AM
TCL
It would be great if you can show me some sample code, or where to look for the reference of how to code it. Thanks
quote:
Originally posted by Kathy P:
One way would be a 'coordinated compound report' utilizing two reports. The first report would be a summary report. The second report would be the detail report. Use the same sort field for both reports. Do not use a defined field for a sort field though. May not work. Hope this helps.



WebFOCUS 764, Oracle to produce report
April 08, 2011, 11:16 AM
TCL
I don't need to drill down link, but simply print all the summary and detail in groups/blocks. Could you show me where to look for the documentation and which one should I read?
quote:
Originally posted by FrankDutch:
if you put the compound report in one PDF you can even make a drill through in that report

in the code you place after the first PDF OPEN
after the second (last) PDF CLOSE



WebFOCUS 764, Oracle to produce report
April 11, 2011, 09:41 AM
Danny-SRL
Hi TCL,

As was said, use the COMPOSER in Dev Studio with the coordinated report option.

Here is an example of code. You can copy it and then open it.

  
-* File master_detail
-* Default Mode: ResourceLayout
SET HTMLARCHIVE=ON
COMPOUND LAYOUT PCHOLD FORMAT PDF
UNITS=IN, $
SECTION=section1, LAYOUT=ON, METADATA='0.5^0.5^0.5^0.5^4', MERGE=ON, ORIENTATION=PORTRAIT, PAGESIZE=Letter,  $
PAGELAYOUT=1, NAME='Page layout 1', text='Page layout 1', TOC-LEVEL=1, BOTTOMMARGIN=0.5, TOPMARGIN=0.5, METADATA='BOTTOMMARGIN=0.5,TOPMARGIN=0.5,LEFTMARGIN=0,RIGHTMARGIN=0,', $
COMPONENT='report1', TEXT='report1', TOC-LEVEL=2, POSITION=(1.354 0.625), DIMENSION=(4.896 0.936), METADATA='Z-INDEX: 100; POSITION: absolute; WIDTH: 4.896in; HEIGHT: 0.936in; OVERFLOW: auto; TOP: 0.625in; LEFT: 1.354in', $
COMPONENT='report2', TEXT='report2', TOC-LEVEL=2, POSITION=(1.350 1.768), DIMENSION=(* *), METADATA='Z-INDEX: 100; POSITION: absolute; WIDTH: 5in; HEIGHT: 2.712in; OVERFLOW: auto; TOP: 1.768in; LEFT: 1.35in', $
END
SET COMPONENT='report1'
-*component_type report
-*focexectool
TABLE FILE CAR
SUM 
     'CAR.BODY.DEALER_COST'
     'CAR.BODY.RETAIL_COST'
     'CAR.BODY.SALES'
BY 'CAR.ORIGIN.COUNTRY'
HEADING
""
FOOTING
""
ON TABLE SET PAGE-NUM OFF 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = endeflt,
$
ENDSTYLE
END
SET COMPONENT='report2'
-*component_type report
-*focexectool
TABLE FILE CAR
SUM 
     'CAR.BODY.DEALER_COST'
     'CAR.BODY.RETAIL_COST'
     'CAR.BODY.SALES'
BY 'CAR.ORIGIN.COUNTRY' NOPRINT
BY 'CAR.COMP.CAR'
HEADING
""
FOOTING
""
ON TABLE SET PAGE-NUM OFF 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = endeflt,
$
ENDSTYLE
END
COMPOUND END




Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

April 11, 2011, 11:12 PM
TCL
After searching for days, I find a solution to use -REPEAT loop to run report1 and report2 alternatively for n times depends on the &LINES of the master file. Sample code as below. Now I have another problem, that there was extra space lines between each report. How can I eliminate that?

QUOTE

SET BYDISPLAY = ON

-* the hold files weren't looking like i expected, so I put them where
-* i could see them easily
APP HOLD BASEAPP
TABLE FILE CAR
SUM
DEALER_COST
BY HIGHEST TOTAL DEALER_COST NOPRINT
BY COUNTRY
-* couldn't get this to work
-*ON TABLE SAVE AS dssown FORMAT COMMA
ON TABLE SAVE AS CARLO FORMAT ALPHA
END
-*OUT_CNT is short for outer count
-SET &OUT_CNT = &LINES ;
-SET &CNTR = 0 ;

-REPEAT LOOP &OUT_CNT TIMES ;
-* CARLO is short for car loop outer
-READ CARLO NOCLOSE &OUTER.A10. &OUTTOT.A7. &JUNK.A7.
-TYPE 'outer'
-TYPE &OUTER
-TYPE 'outtot'
-TYPE &OUTTOT
-SET &CNTR = &CNTR + 1 ;
-*SET COMPOUND = OPEN
-SET &CMP_FLG = IF &CNTR EQ &OUT_CNT THEN 'CLOSE' ELSE IF &CNTR EQ 1 THEN 'OPEN NOBREAK' ELSE 'NOBREAK' ;
-TYPE 'cmpflg'
-TYPE &CMP_FLG
SET COMPOUND = &CMP_FLG
TABLE FILE CAR
SUM
DEALER_COST/D12.2M AS 'Dealer cost sum'
BY HIGHEST TOTAL DEALER_COST NOPRINT
BY COUNTRY AS 'Country'
WHERE COUNTRY EQ '&OUTER'
ON TABLE SET STYLE *
UNITS=IN, PAGESIZE='Letter', LEFTMARGIN=0.250000, RIGHTMARGIN=0.250000,
TOPMARGIN=0.250000, BOTTOMMARGIN=0.250000, SQUEEZE=OFF,
ORIENTATION=PORTRAIT, $
ENDSTYLE
-*ON TABLE PCHOLD FORMAT DHTML
END

-RUN

TABLE FILE CAR
SUM
DEALER_COST
-* COMPUTE HEADNET /D15.2 = SumOfNET_AMT ; NOPRINT
BY HIGHEST TOTAL DEALER_COST NOPRINT
BY CAR
-*PRINT
-*WELL
-*-*WELL_NAME
-*-*PAYCM_ID
-*-*SumOfNET_AMT
-*BY HIGHEST TOTAL SumOfNET_AMT NOPRINT
-*BY WELL_ID NOPRINT
-*BY PAYCM_ID NOPRINT
WHERE COUNTRY EQ '&OUTER'
ON TABLE SAVE AS CARLI FORMAT ALPHA
END

-RUN
-SET &IN_CNT = &LINES ;

-TYPE 'wellcnt'
-TYPE &IN_CNT

-*pool is loop spelled backwards
-REPEAT POOL &IN_CNT TIMES ;
-* CARLI is car loop inner
-READ CARLI NOCLOSE &INCTY.A16. &JUNK3.A7. &JUNK4.A7.

-TYPE 'innerowner'
-TYPE &OUTER
-TYPE 'inner cty (country)'
-TYPE &INCTY

SET COMPOUND = NOBREAK
TABLE FILE CAR
SUM
DEALER_COST
BY HIGHEST TOTAL DEALER_COST NOPRINT
-* BY WELL_ID
BY COUNTRY NOPRINT
BY CAR
-*PRINT
-*WELL_ID
-*WELL_NAME
-*PAYCM_ID
-*SumOfNET_AMT
-*BY HIGHEST TOTAL SumOfNET_AMT NOPRINT
-*BY WELL_ID NOPRINT
-*BY PAYCM_ID NOPRINT
WHERE COUNTRY EQ '&OUTER' AND CAR EQ '&INCTY'
-*ON TABLE PCHOLD FORMAT PDF
-*ON TABLE PCHOLD FORMAT DHTML
ON TABLE SET STYLE *
SQUEEZE=OFF,
$
ENDSTYLE
END
-RUN

-POOL
-CLOSE CARLI

END
-LOOP
-CLOSE CARLO

UNQOUTE


WebFOCUS 764, Oracle to produce report