Focal Point
[SOLVED] Looping question

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

January 09, 2020, 08:28 AM
pav
[SOLVED] Looping question
Hello All,

I am having a question on the PDF report using PDF OPEN and CLOSE.

Is that possible Can we do the MERGE=ON in PDF OPEN CLOSE Compound report like we do in Document Composer(CO-ordinate report)?

I am trying to achieve a report by appending 3 holds and need to have repeat for all the 3 holds for each BY field values.

Thank You.

This message has been edited. Last edited by: FP Mod Chuck,
January 09, 2020, 08:33 AM
BabakNYC
What's the question?
What version of WebFOCUS?
Can you give us a summarized version of your code?


WebFOCUS 8206, Unix, Windows
January 09, 2020, 09:07 AM
pav
Hi BabakNYC,
I updated my question.
I am using 8.1.05 App Studio.
Thank You.
January 09, 2020, 09:55 AM
Fernando
Pav, Are you trying to combine hold files in a loop and then report off that new file or are you trying to create a compound report using a loop?

Fernando


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
January 09, 2020, 01:19 PM
pav
Hello Fernando,

I am looping the compound report.

Thank You.
January 09, 2020, 02:53 PM
Fernando
Pav, Here is code that I created using the Document Wizard:

SET HTMLARCHIVE=ON
*-HOLD_SOURCE
COMPOUND LAYOUT PCHOLD FORMAT PDF
UNITS=IN, $
SECTION=section1, LAYOUT=ON, METADATA='prop_with_names^Margins_Left=0.5^Margins_Top=0.5^Margins_Right=0.5^Margins_Bottom=0.5^thumbnailscale=4', MERGE=OFF, ORIENTATION=PORTRAIT, PAGESIZE=Letter, SHOW_GLOBALFILTER=OFF, $
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=(0.719 0.990), DIMENSION=(6.667 1.406), BYTOC=0,  ARREPORTSIZE=DIMENSION, METADATA='left: 0.719in; top: 0.99in; width: 6.667in; height: 1.406in; position: absolute; z-index: 1;', $
COMPONENT='report2', TEXT='report2', TOC-LEVEL=2, POSITION=(0.771 3.073), DIMENSION=(6.458 1.042), BYTOC=0,  ARREPORTSIZE=DIMENSION, METADATA='left: 0.771in; top: 3.073in; width: 6.458in; height: 1.042in; position: absolute; z-index: 2;', $
COMPONENT='report3', TEXT='report3', TOC-LEVEL=2, POSITION=(1.031 5.000), DIMENSION=(6.042 1.042), BYTOC=0,  ARREPORTSIZE=DIMENSION, METADATA='left: 1.031in; top: 5in; width: 6.042in; height: 1.042in; position: absolute; z-index: 3;', $
END
SET COMPONENT='report1'
-*component_type report
-INCLUDE IBFS:/WFC/Repository/Fake/rep1.fex
SET COMPONENT='report2'
-*component_type report
-INCLUDE IBFS:/WFC/Repository/Fake/rep2.fex
SET COMPONENT='report3'
-*component_type report
-INCLUDE IBFS:/WFC/Repository/Fake/rep3.fex
COMPOUND END


You will notice that there is no open or close.

The trick is get:
   
COMPONENT='reportx', TEXT='reportx', TOC-LEVEL=2, POSITION=(1.031 5.000), DIMENSION=(6.042 1.042), BYTOC=0,  ARREPORTSIZE=DIMENSION, METADATA='left: 1.031in; top: 5in; width: 6.042in; height: 1.042in; position: absolute; z-index: 3;', $


and lower section
SET COMPONENT='reportx'
-*component_type report
-INCLUDE IBFS:/WFC/Repository/Fake/somerep.fex


to match.

I admit that I am using include but you don't have too. Here is a sample of that:

-* Default Mode: ResourceLayout
SET HTMLARCHIVE=ON
*-HOLD_SOURCE
COMPOUND LAYOUT PCHOLD FORMAT PDF
UNITS=IN, $
SECTION=section1, LAYOUT=ON, METADATA='prop_with_names^Margins_Left=0.5^Margins_Top=0.5^Margins_Right=0.5^Margins_Bottom=0.5^thumbnailscale=4', MERGE=OFF, ORIENTATION=PORTRAIT, PAGESIZE=Letter, SHOW_GLOBALFILTER=OFF, $
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=(0.875 1.198), DIMENSION=(6.458 1.198), BYTOC=0,  ARREPORTSIZE=DIMENSION, METADATA='left: 0.875in; top: 1.198in; width: 6.458in; height: 1.198in; position: absolute; z-index: 1;', $
COMPONENT='report2', TEXT='report2', TOC-LEVEL=2, POSITION=(0.979 2.865), DIMENSION=(5.990 1.406), BYTOC=0,  ARREPORTSIZE=DIMENSION, METADATA='left: 0.979in; top: 2.865in; width: 5.99in; height: 1.406in; position: absolute; z-index: 2;', $
END
SET COMPONENT='report1'
-*component_type report
-* File: IBFS:/DEV3/WFC/Repository/Commercial_Lines_Portal/FUS/Reports/Report1.fex Created by WebFOCUS AppStudio
-*-SET &ECHO=ALL;

-DEFAULTH &POL_EFFECTIVE_YEAR=0

-* Note making this larger adds 2 lines to the top of the report
SET LINES=998

TABLE FILE CAR
BY CAR
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/combine_templates/ENFlat.sty,
     UNITS=PTS,
$
     LEFTMARGIN=0.00000,
     RIGHTMARGIN=0.00000,
     TOPMARGIN=0.00000,
     BOTTOMMARGIN=0.00000,
$
TYPE=REPORT,
     LEFTGAP=3,
     RIGHTGAP=3,
     WRAP=OFF,
$
TYPE=DATA,
     BACKCOLOR=( 'WHITE' RGB(243 243 243) ),
$
ENDSTYLE
END
SET COMPONENT='report2'

TABLE FILE CAR
BY HIGHEST COUNTRY
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/FILE/IBI_HTML_DIR/javaassist/intl/EN/combine_templates/ENFlat.sty,
     UNITS=PTS,
$
     LEFTMARGIN=0.00000,
     RIGHTMARGIN=0.00000,
     TOPMARGIN=0.00000,
     BOTTOMMARGIN=0.00000,
$
TYPE=REPORT,
     LEFTGAP=3,
     RIGHTGAP=3,
     WRAP=OFF,
$
TYPE=DATA,
     BACKCOLOR=( 'WHITE' RGB(243 243 243) ),
$
ENDSTYLE
END
-END_PROC
COMPOUND END


Using this technique I would use a loop that generates each

COMPONENT section

and another loop to generate:

the set compound section:

SET COMPONENT='report2'


This is tricky since they have to be perfect to work and you would be generating Webfocus code not hold files.

Hope that this makes sense to you.

Fernando


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
January 13, 2020, 08:54 AM
pav
Thanks Fernando, I am going to try you suggestion.
January 13, 2020, 01:27 PM
Fernando
Hi Pav, If you have code the uses OPEN CLOSE without a loop can you post it? Maybe there is an easier way.

Fernando

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


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
January 14, 2020, 01:38 PM
pav
Fernando, You are awesome.
I got the PDF open close working in a loop.
Thanks for your support.
January 15, 2020, 11:37 AM
Fernando
Pav you are welcome.

Fernando


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03